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 @@ -98,7 +98,10 @@ define( [
9898 placeholder : "" ,
9999
100100 build : function ( ) {
101- var self = this ;
101+ var self = this ,
102+ escapeId = function ( id ) {
103+ return id . replace ( / ( [ ! " # $ % & ' ( ) * + , . / : ; < = > ? @ [ \] ^ ` { | } ~ ] ) / g, "\\$1" ) ;
104+ }
102105
103106 // Create list from select, update state
104107 self . refresh ( ) ;
@@ -128,9 +131,9 @@ define( [
128131
129132 self . _decideFormat ( ) ;
130133 if ( self . menuType === "overlay" ) {
131- self . button . attr ( "href" , "#" + self . popupID ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "popup" ) ;
134+ self . button . attr ( "href" , "#" + escapeId ( self . popupID ) ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "popup" ) ;
132135 } else {
133- self . button . attr ( "href" , "#" + self . dialogID ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "dialog" ) ;
136+ self . button . attr ( "href" , "#" + escapeId ( self . dialogID ) ) . attr ( "data-" + ( $ . mobile . ns || "" ) + "rel" , "dialog" ) ;
134137 }
135138 self . isOpen = true ;
136139 // 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