From ce64d01a944071c15663712ae1da3603158d9c82 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 2 Sep 2021 02:03:44 +0200 Subject: [PATCH] fd --- files/routes/comments.py | 10 +++++----- files/routes/posts.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 58f289385..8fed20d1b 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -293,7 +293,7 @@ def api_comment(v): g.db.add(c_aux) g.db.flush() - if "ivermectin" in c_aux.body_html.lower(): + if "rdrama" in request.host and "ivermectin" in c_aux.body_html.lower(): c.is_banned = True c.ban_reason = "ToS Violation" @@ -311,16 +311,16 @@ def api_comment(v): g.db.add(c_jannied) g.db.flush() - body = VAXX_MSG.format(username=v.username) + body2 = VAXX_MSG.format(username=v.username) with CustomRenderer(post_id=parent_id) as renderer: - body_md = renderer.render(mistletoe.Document(body)) + body_md = renderer.render(mistletoe.Document(body2)) body_jannied_html = sanitize(body_md) c_aux = CommentAux( id=c_jannied.id, body_html=body_jannied_html, - body=body + body=body2 ) g.db.add(c_aux) g.db.flush() @@ -663,7 +663,7 @@ def edit_comment(cid, v): c.body = body[:10000] c.body_html = body_html[:20000] - if "ivermectin" in c.body_html.lower(): + if "rdrama" in request.host and "ivermectin" in c.body_html.lower(): c.is_banned = True c.ban_reason = "ToS Violation" diff --git a/files/routes/posts.py b/files/routes/posts.py index fcff4f75b..91c8681c1 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -290,7 +290,7 @@ def edit_post(pid, v): if int(time.time()) - p.created_utc > 60 * 3: p.edited_utc = int(time.time()) g.db.add(p) - if "ivermectin" in body_html.lower(): + if "rdrama" in request.host and "ivermectin" in body_html.lower(): p.is_banned = True p.ban_reason = "ToS Violation" @@ -871,7 +871,7 @@ def submit_post(v): g.db.flush() - if "ivermectin" in new_post_aux.body_html.lower(): + if "rdrama" in request.host and "ivermectin" in new_post_aux.body_html.lower(): new_post.is_banned = True new_post.ban_reason = "ToS Violation"