Skip to content

Commit 45f26d7

Browse files
committed
Better parsing of hosts file system addresses
Related issue: - uBlockOrigin/uBlock-issues#877
1 parent 6739718 commit 45f26d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/js/static-filtering-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const Parser = class {
102102
this.netOptionsIterator = new NetOptionsIterator(this);
103103
this.extOptionsIterator = new ExtOptionsIterator(this);
104104
this.maxTokenLength = Number.MAX_SAFE_INTEGER;
105-
this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)\b/;
105+
this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)(?:[^\w.-]|$)/;
106106
this.reHostname = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+/;
107107
this.reHostsSink = /^[\w-.:\[\]]+$/;
108108
this.reHostsSource = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+$/;

0 commit comments

Comments
 (0)