diff --git a/files/routes/comments.py b/files/routes/comments.py index f14b01d3e..a1b5cce04 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -685,6 +685,9 @@ def edit_comment(cid, v): if time.time() - c.created_utc > 3*24*60*60 and not (c.post and c.post.draft) and v.admin_level < PERMS["IGNORE_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_EDITING_LIMIT: stop(403, "You can't edit comments older than 3 days!") + if c.is_banned: + stop(403, "You can't edit comments that were removed by admins!") + if c.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_EDITING']: stop(403) diff --git a/files/routes/posts.py b/files/routes/posts.py index c62a5e7dd..beffb2822 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1068,6 +1068,9 @@ def edit_post(pid, v): if time.time() - p.created_utc > days*24*60*60 and not p.draft and v.admin_level < PERMS["IGNORE_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_EDITING_LIMIT: stop(403, f"You can't edit posts older than {days} days!") + if p.is_banned: + stop(403, "You can't edit posts that were removed by admins!") + title = request.values.get("title", "").strip() if len(title) > POST_TITLE_LENGTH_LIMIT: stop(400, f'Post title is too long (max {POST_TITLE_LENGTH_LIMIT} characters)')