Skip to content

Commit 0fc5792

Browse files
committed
Check if topic title is a link
1 parent 4a89092 commit 0fc5792

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/forum.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ proc stopForumSpamCheck(c: TForumData): bool =
260260
proc spamHeuristicsCheck(c: TForumData, content: string, topic = ""): bool =
261261
if c.rank == Moderated:
262262
var spamScore = 0.0
263+
if topic.startsWith("https://") or topic.startsWith("http://") or topic.startsWith("www."):
264+
spamScore += 1.0
263265
if topic.len > 8 and topic.allCharsInSet(UppercaseLetters + Digits + Whitespace):
264266
spamScore += 1.0
265267
let dollar = content.find('$')

0 commit comments

Comments
 (0)