From 6b0e6b49ee8588f1f583b7181898f21d047ef46f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 13 Oct 2022 15:26:59 +0200 Subject: [PATCH] disallow discord links in DMs --- files/routes/users.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/routes/users.py b/files/routes/users.py index c4e3c30e7..f64fa6ece 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -510,6 +510,9 @@ def message2(v, username): if 'linkedin.com' in message: abort(403, "This domain 'linkedin.com' is banned.") + if 'discord.gg' in message or 'discord.com' in message or 'discordapp.com' in message: + abort(403, "Stop grooming!") + body_html = sanitize(message) if not (SITE == 'rdrama.net' and user.id == BLACKJACKBTZ_ID): @@ -574,7 +577,10 @@ def messagereply(v): if not body and not request.files.get("file"): abort(400, "Message is empty!") - if 'linkedin.com' in body: abort(400, "this domain 'linkedin.com' is banned") + if 'linkedin.com' in body: abort(403, "This domain 'linkedin.com' is banned") + + if 'discord.gg' in body or 'discord.com' in body or 'discordapp.com' in body: + abort(403, "Stop grooming!") id = int(request.values.get("parent_id")) parent = get_comment(id, v=v)