make sure a single \/ is not treated as a valid regex

This commit is contained in:
gorhill 2015-02-13 18:52:35 -05:00
parent 24afff491d
commit 94dd2b3d86
1 changed files with 1 additions and 1 deletions

View File

@ -1506,7 +1506,7 @@ FilterParser.prototype.parse = function(s) {
}
// regex?
if ( s.charAt(0) === '/' && s.slice(-1) === '/' ) {
if ( s.charAt(0) === '/' && s.slice(-1) === '/' && s.lenght > 2 ) {
this.isRegex = true;
this.f = s.slice(1, -1);
return this;