From f8ec54c635345b6955b0710740f40a5af9ec1d8e Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 10 Jan 2020 11:07:31 -0500 Subject: [PATCH] Fix compatibility issue with hosts files Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/847 IP address `0` is a valid synonym of `0.0.0.0`. --- src/js/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/storage.js b/src/js/storage.js index 7a214dbea..dc4d5bf38 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -828,7 +828,7 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { const reIsWhitespaceChar = /\s/; const reMaybeLocalIp = /^[\d:f]/; const reIsLocalhostRedirect = /\s+(?:0\.0\.0\.0|broadcasthost|localhost|local|ip6-\w+)\b/; - const reLocalIp = /^(?:0\.0\.0\.0|127\.0\.0\.1|::1?|fe80::1%lo0)\s+/; + const reLocalIp = /^(?:(0\.0\.0\.)?0|127\.0\.0\.1|::1?|fe80::1%lo0)\s+/; const lineIter = new this.LineIterator(this.processDirectives(rawText)); while ( lineIter.eot() === false ) {