From a6b13e6b9cd48eacdac63cc3f40ce179dc13fd1d Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 7 May 2023 09:19:39 -0400 Subject: [PATCH] Fix hostname-detecting regex Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2639 --- src/js/static-filtering-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index a813b9d34..28322bb81 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -762,7 +762,7 @@ export class AstFilterParser { this.reNetHosts1 = /^127\.0\.0\.1 (?:[\da-z][\da-z_-]*\.)+[\da-z-]*[a-z]$/; this.reNetHosts2 = /^0\.0\.0\.0 (?:[\da-z][\da-z_-]*\.)+[\da-z-]*[a-z]$/; this.rePlainGenericCosmetic = /^##[.#][A-Za-z_][\w-]*$/; - this.reHostnameAscii = /^(?:[\da-z][\da-z_-]*\.)*[\da-z-]*[\da-z]$/; + this.reHostnameAscii = /^(?:[\da-z][\da-z_-]*\.)*[\da-z][\da-z-]*[\da-z]$/; this.rePlainEntity = /^(?:[\da-z][\da-z_-]*\.)+\*$/; this.reHostsSink = /^[\w%.:\[\]-]+\s+/; this.reHostsRedirect = /(?:0\.0\.0\.0|broadcasthost|local|localhost(?:\.localdomain)?|ip6-\w+)(?:[^\w.-]|$)/;