From 14076fe8c042dcdfc77f3ce6c83175f44028c49f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 24 Jun 2021 11:48:27 -0400 Subject: [PATCH] Take care of misreporting spurious filter syntax error Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1596 --- src/js/static-filtering-parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 3dcc83f1c..a9cf0f1f5 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -103,9 +103,9 @@ const Parser = class { this.extOptionsIterator = new ExtOptionsIterator(this); this.maxTokenLength = Number.MAX_SAFE_INTEGER; this.expertMode = options.expertMode !== false; - this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)(?:[^\w.-]|$)/; + this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|broadcasthost|local|localhost(?:\.localdomain)?|ip6-\w+)(?:[^\w.-]|$)/; this.reHostname = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+/; - this.reHostsSink = /^[\w-.:\[\]]+$/; + this.reHostsSink = /^[\w%.:\[\]-]+$/; this.reHostsSource = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+$/; this.reUnicodeChar = /[^\x00-\x7F]/; this.reUnicodeChars = /[^\x00-\x7F]/g;