mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Issue #1628: fix — parse out @ characters from lists.
This commit is contained in:
@@ -634,7 +634,7 @@ class TestMatchesExclusions(Base):
|
||||
self.assertTrue(matches_exclusions(domain, exclusion_regexes))
|
||||
|
||||
def test_match_raw_list(self):
|
||||
exclusion_regexes = [r".*\.com", r".*\.org", r".*\.edu"]
|
||||
exclusion_regexes = [r".*\.com", r".*\.org", r".*\.edu", r".*@.*"]
|
||||
exclusion_regexes = [re.compile(regex) for regex in exclusion_regexes]
|
||||
|
||||
for domain in [
|
||||
@@ -642,6 +642,7 @@ class TestMatchesExclusions(Base):
|
||||
"yahoo.com",
|
||||
"adaway.org",
|
||||
"education.edu",
|
||||
"a.stro.lo.gy@45.144.225.135",
|
||||
]:
|
||||
self.assertTrue(matches_exclusions(domain, exclusion_regexes))
|
||||
|
||||
|
||||
@@ -943,6 +943,10 @@ def remove_dups_and_excl(merge_file, exclusion_regexes, output_file=None):
|
||||
if not stripped_rule or matches_exclusions(stripped_rule, exclusion_regexes):
|
||||
continue
|
||||
|
||||
# Issue #1628
|
||||
if ("@" in stripped_rule):
|
||||
continue
|
||||
|
||||
# Normalize rule
|
||||
hostname, normalized_rule = normalize_rule(
|
||||
stripped_rule,
|
||||
|
||||
Reference in New Issue
Block a user