We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0445da commit db6575cCopy full SHA for db6575c
peterbecom/plog/spamprevention.py
@@ -55,6 +55,16 @@ def contains_spam_patterns(text):
55
if pattern["pattern"] in text:
56
increment_pattern(pattern["id"])
57
return True
58
+
59
+ qs = SpamCommentPattern.objects.filter(is_url_pattern=False, is_regex=True).values(
60
+ "pattern", "id"
61
+ )
62
+ for pattern in qs:
63
+ regex = re.compile(pattern["pattern"])
64
+ if regex.search(text):
65
+ increment_pattern(pattern["id"])
66
+ return True
67
68
return False
69
70
0 commit comments