Skip to content

Commit

Permalink
findspam.py: Add IP addresses to websites, too (#3722)
Browse files Browse the repository at this point in the history
  • Loading branch information
tripleee committed Apr 3, 2020
1 parent 7a60a43 commit 298966f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions findspam.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,16 @@ def reload_blacklists(cls):
pass
cls.rule_bad_keywords.sanity_check()
cls.rule_watched_keywords.regex = r'(?is)(?:^|\b|(?w:\b))(?:{})(?:\b|(?w:\b)|$)'.format(
"|".join(GlobalVars.watched_keywords.keys()))
"|".join(list(GlobalVars.watched_keywords.keys()) + [
regex.escape(x) for x in GlobalVars.watched_cidrs]))
try:
del cls.rule_watched_keywords.compiled_regex
except AttributeError:
pass
cls.rule_watched_keywords.sanity_check()
cls.rule_blacklisted_websites.regex = r"(?i)({})".format(
"|".join(GlobalVars.blacklisted_websites))
"|".join(GlobalVars.blacklisted_websites + [
regex.escape(x) for x in GlobalVars.blacklisted_cidrs]))
try:
del cls.rule_blacklisted_websites.compiled_regex
except AttributeError:
Expand Down

0 comments on commit 298966f

Please sign in to comment.