From b9d6f796a33be3aa452e7e1a4248b9c4e2b49a0f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Jul 2022 13:13:59 +0200 Subject: [PATCH] return 404 on shadowbanned comments when linking to them --- files/routes/comments.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/comments.py b/files/routes/comments.py index d4a459ea5..e4c983484 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -45,6 +45,9 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): comment = get_comment(cid, v=v) + if comment.author.shadowbanned and not (v and v.shadowbanned) and not (v and v.admin_level >= 2): + abort(404) + if v and request.values.get("read"): notif = g.db.query(Notification).filter_by(comment_id=cid, user_id=v.id, read=False).one_or_none() if notif: