File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,24 @@ $.widget( "ui.tabs", {
3636 var rhash = / # .* $ / ;
3737
3838 return function ( anchor ) {
39+ var anchorUrl , locationUrl ;
3940
4041 // support: IE7
4142 // IE7 doesn't normalize the href property when set via script (#9317)
4243 anchor = anchor . cloneNode ( false ) ;
4344
44- return anchor . hash . length > 1 &&
45- decodeURIComponent ( anchor . href . replace ( rhash , "" ) ) ===
46- decodeURIComponent ( location . href . replace ( rhash , "" ) ) ;
45+ anchorUrl = anchor . href . replace ( rhash , "" ) ;
46+ locationUrl = location . href . replace ( rhash , "" ) ;
47+
48+ // decoding may throw an error if the URL isn't UTF-8 (#9518)
49+ try {
50+ anchorUrl = decodeURIComponent ( anchorUrl ) ;
51+ } catch ( error ) { }
52+ try {
53+ locationUrl = decodeURIComponent ( locationUrl ) ;
54+ } catch ( error ) { }
55+
56+ return anchor . hash . length > 1 && anchorUrl === locationUrl ;
4757 } ;
4858 } ) ( ) ,
4959
You can’t perform that action at this time.
0 commit comments