1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-05 18:32:30 +01:00

Better parsing of hosts file system addresses

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/877
This commit is contained in:
Raymond Hill 2020-08-10 10:56:28 -04:00
parent 673971875d
commit 45f26d7319
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -102,7 +102,7 @@ const Parser = class {
this.netOptionsIterator = new NetOptionsIterator(this);
this.extOptionsIterator = new ExtOptionsIterator(this);
this.maxTokenLength = Number.MAX_SAFE_INTEGER;
this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)\b/;
this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)(?:[^\w.-]|$)/;
this.reHostname = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+/;
this.reHostsSink = /^[\w-.:\[\]]+$/;
this.reHostsSource = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+$/;