diff options
-rw-r--r-- | bot/exts/filters/filtering.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 10cc7885d..b7e91395e 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -478,15 +478,16 @@ class Filtering(Cog): Second return value is a reason of URL blacklisting (can be None). """ text = self.clean_input(text) - if not URL_RE.search(text): + matches = URL_RE.findall(text) + if not matches: return False, None - text = text.lower() domain_blacklist = self._get_filterlist_items("domain_name", allowed=False) for url in domain_blacklist: - if url.lower() in text: - return True, self._get_filterlist_value("domain_name", url, allowed=False)["comment"] + for match in matches: + if url.lower() in match.lower(): + return True, self._get_filterlist_value("domain_name", url, allowed=False)["comment"] return False, None |