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", {
36
36
var rhash = / # .* $ / ;
37
37
38
38
return function ( anchor ) {
39
+ var anchorUrl , locationUrl ;
39
40
40
41
// support: IE7
41
42
// IE7 doesn't normalize the href property when set via script (#9317)
42
43
anchor = anchor . cloneNode ( false ) ;
43
44
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 ;
47
57
} ;
48
58
} ) ( ) ,
49
59
You can’t perform that action at this time.
0 commit comments