aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jeremiah Boby <[email protected]>2019-10-13 18:03:07 +0100
committerGravatar Jeremiah Boby <[email protected]>2019-10-13 18:11:29 +0100
commit83e49c25d0cdd473ddf2d5feb4aa85d041ed596b (patch)
treeae830f17ac6c511dd17d8b60d5152e81960e4a1f
parentMerge pull request #505 from python-discord/user-log-display-name-changes (diff)
Check partially hidden words against the wordlist
-rw-r--r--bot/cogs/filtering.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py
index 265ae5160..875276d8a 100644
--- a/bot/cogs/filtering.py
+++ b/bot/cogs/filtering.py
@@ -26,6 +26,7 @@ INVITE_RE = re.compile(
flags=re.IGNORECASE
)
+SPOILER_RE = re.compile(r"(\|\|.+?\|\|)")
URL_RE = re.compile(r"(https?://[^\s]+)", flags=re.IGNORECASE)
ZALGO_RE = re.compile(r"[\u0300-\u036F\u0489]")
@@ -237,7 +238,7 @@ class Filtering(Cog):
Only matches words with boundaries before and after the expression.
"""
for regex_pattern in WORD_WATCHLIST_PATTERNS:
- if regex_pattern.search(text):
+ if regex_pattern.search(text + SPOILER_RE.sub('', text)):
return True
return False