This commit is contained in:
gorhill 2017-08-30 19:03:02 -04:00
parent ab1b23a398
commit 73387e54ad
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 3 deletions

View File

@ -213,7 +213,7 @@ rawToRegexStr.escape1 = /[.+?${}()|[\]\\]/g;
rawToRegexStr.escape2 = /\^/g; rawToRegexStr.escape2 = /\^/g;
rawToRegexStr.escape3 = /^\*|\*$/g; rawToRegexStr.escape3 = /^\*|\*$/g;
rawToRegexStr.escape4 = /\*/g; rawToRegexStr.escape4 = /\*/g;
rawToRegexStr.reTextHostnameAnchor = '^[a-z-]+://(?:[^/?#]+\\.)?'; rawToRegexStr.reTextHostnameAnchor = '^[a-z-]+://(?:[^/?#]+\\.?)?';
var filterFingerprinter = µb.CompiledLineWriter.fingerprint; var filterFingerprinter = µb.CompiledLineWriter.fingerprint;
@ -624,8 +624,7 @@ FilterGenericHnAnchored.prototype.match = function(url) {
if ( this.re === null ) { if ( this.re === null ) {
this.re = new RegExp(rawToRegexStr(this.s, this.anchor)); this.re = new RegExp(rawToRegexStr(this.s, this.anchor));
} }
var matchStart = url.search(this.re); return this.re.test(url);
return matchStart !== -1 && isHnAnchored(url, matchStart);
}; };
FilterGenericHnAnchored.prototype.reSourceOffset = FilterGenericHnAnchored.prototype.reSourceOffset =