This repository was archived by the owner on Oct 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,10 @@ define( [
9999 placeholder : "" ,
100100
101101 build : function ( ) {
102- var self = this ;
102+ var self = this ,
103+ escapeId = function ( id ) {
104+ return id . replace ( / ( [ ! " # $ % & ' ( ) * + , . / : ; < = > ? @ [ \] ^ ` { | } ~ ] ) / g, "\\$1" ) ;
105+ }
103106
104107 // Create list from select, update state
105108 self . refresh ( ) ;
@@ -129,9 +132,9 @@ define( [
129132
130133 self . _decideFormat ( ) ;
131134 if ( self . menuType === "overlay" ) {
132- self . button . attr ( "href" , "#" + self . popupID ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "popup" ) ;
135+ self . button . attr ( "href" , "#" + escapeId ( self . popupID ) ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "popup" ) ;
133136 } else {
134- self . button . attr ( "href" , "#" + self . dialogID ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "dialog" ) ;
137+ self . button . attr ( "href" , "#" + escapeId ( self . dialogID ) ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "dialog" ) ;
135138 }
136139 self . isOpen = true ;
137140 // Do not prevent default, so the navigation may have a chance to actually open the chosen format
You can’t perform that action at this time.
0 commit comments