return 404 on shadowbanned comments when linking to them

master
Aevann1 2022-07-08 13:13:59 +02:00
parent 747ccf5dab
commit b9d6f796a3
1 changed files with 3 additions and 0 deletions

View File

@ -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: