Fix whitelisting issue when RAW list are given.
authorfunilrys <redacted>
Tue, 13 Jul 2021 18:11:28 +0000 (20:11 +0200)
committerfunilrys <redacted>
Tue, 13 Jul 2021 18:11:28 +0000 (20:11 +0200)
This patch fixes #1687.

Indeed, before this patch, the whitelisting of a RAW/Plain list of domain
was overlooked.

updateHostsFile.py

index 1bb937c1bb005a0bbcc83ee3d96210170db38e16..4dc5a885b5cbf1694dff801f060d5edeba221921 100644 (file)
@@ -955,7 +955,7 @@ def remove_dups_and_excl(merge_file, exclusion_regexes, output_file=None):
         )
 
         for exclude in exclusions:
-            if re.search(r"[\s\.]" + re.escape(exclude) + r"\s", line):
+            if re.search(r"(^|[\s\.])" + re.escape(exclude) + r"\s", line):
                 write_line = False
                 break
 
git clone https://git.99rst.org/PROJECT