mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Honor whitelist exclusion only for domain or subdomain match
* Whitelisting `s.youtube.com` should not whitelist `ads.youtube.com`; but can whitelist `a.s.youtube.com` * Whitelisting `twitter.com` should not whitelist `ttwitter.com` or `twitter.com.au`; but can whitelist `a.twitter.com`
This commit is contained in:
@@ -471,7 +471,7 @@ def remove_dups_and_excl(merge_file):
|
||||
# Normalize rule
|
||||
hostname, normalized_rule = normalize_rule(stripped_rule)
|
||||
for exclude in exclusions:
|
||||
if exclude in line:
|
||||
if re.search('[\s\.]' + re.escape(exclude) + '\s', line):
|
||||
write_line = False
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user