Skip to content

Commit 9f9ccf3

Browse files
kyle-mccarthydesandro
authored andcommitted
Replace negative lookbehind with a more supported regular expression (#837)
* provide fix for bug related to parsing GET parameters * expand to test for a path that has already escaped the query string * remove negative lookbehind and replaced with alternative regexp due to firefox incompatibility * follow code style
1 parent eb58390 commit 9f9ccf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ proto.updateGetPathTemplate = function( optPath ) {
235235
// convert path option into regex to look for pattern in location
236236
// escape query (?) in url, allows for parsing GET parameters
237237
var regexString = optPath
238-
.replace( /(?<!\\)\?/, '\\?' )
238+
.replace( /(\\\?|\?)/, '\\?' )
239239
.replace( '{{#}}', '(\\d\\d?\\d?)' );
240240
var templateRe = new RegExp( regexString );
241241
var match = location.href.match( templateRe );

0 commit comments

Comments
 (0)