From 73387e54ada3444c15a6d0a3fa1b519bf01e7225 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 30 Aug 2017 19:03:02 -0400 Subject: [PATCH] fix #2938 --- src/js/static-net-filtering.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index c50a92ed2..45a04a43e 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -213,7 +213,7 @@ rawToRegexStr.escape1 = /[.+?${}()|[\]\\]/g; rawToRegexStr.escape2 = /\^/g; rawToRegexStr.escape3 = /^\*|\*$/g; rawToRegexStr.escape4 = /\*/g; -rawToRegexStr.reTextHostnameAnchor = '^[a-z-]+://(?:[^/?#]+\\.)?'; +rawToRegexStr.reTextHostnameAnchor = '^[a-z-]+://(?:[^/?#]+\\.?)?'; var filterFingerprinter = µb.CompiledLineWriter.fingerprint; @@ -624,8 +624,7 @@ FilterGenericHnAnchored.prototype.match = function(url) { if ( this.re === null ) { this.re = new RegExp(rawToRegexStr(this.s, this.anchor)); } - var matchStart = url.search(this.re); - return matchStart !== -1 && isHnAnchored(url, matchStart); + return this.re.test(url); }; FilterGenericHnAnchored.prototype.reSourceOffset =