@@ -121,14 +121,14 @@ $.widget( "ui.tabs", {
121
121
_initialActive : function ( ) {
122
122
var active = this . options . active ,
123
123
collapsible = this . options . collapsible ,
124
- locationHash = location . hash . substring ( 1 ) ;
124
+ locationHashDecoded = decodeURIComponent ( location . hash . substring ( 1 ) ) ;
125
125
126
126
if ( active === null ) {
127
127
128
128
// check the fragment identifier in the URL
129
- if ( locationHash ) {
129
+ if ( locationHashDecoded ) {
130
130
this . tabs . each ( function ( i , tab ) {
131
- if ( $ ( tab ) . attr ( "aria-controls" ) === locationHash ) {
131
+ if ( $ ( tab ) . attr ( "aria-controls" ) === locationHashDecoded ) {
132
132
active = i ;
133
133
return false ;
134
134
}
@@ -312,10 +312,6 @@ $.widget( "ui.tabs", {
312
312
}
313
313
} ,
314
314
315
- _sanitizeSelector : function ( hash ) {
316
- return hash ? hash . replace ( / [ ! " $ % & ' ( ) * + , . \/ : ; < = > ? @ \[ \] \^ ` { | } ~ ] / g, "\\$&" ) : "" ;
317
- } ,
318
-
319
315
refresh : function ( ) {
320
316
var options = this . options ,
321
317
lis = this . tablist . children ( ":has(a[href])" ) ;
@@ -434,9 +430,9 @@ $.widget( "ui.tabs", {
434
430
435
431
// Inline tab
436
432
if ( that . _isLocal ( anchor ) ) {
437
- selector = anchor . hash ;
433
+ selector = decodeURIComponent ( anchor . hash ) ;
438
434
panelId = selector . substring ( 1 ) ;
439
- panel = that . element . find ( that . _sanitizeSelector ( selector ) ) ;
435
+ panel = that . element . find ( "#" + CSS . escape ( panelId ) ) ;
440
436
441
437
// remote tab
442
438
} else {
@@ -874,7 +870,7 @@ $.widget( "ui.tabs", {
874
870
875
871
_getPanelForTab : function ( tab ) {
876
872
var id = $ ( tab ) . attr ( "aria-controls" ) ;
877
- return this . element . find ( this . _sanitizeSelector ( "#" + id ) ) ;
873
+ return this . element . find ( "#" + CSS . escape ( id ) ) ;
878
874
}
879
875
} ) ;
880
876
0 commit comments