diff --git a/files/routes/comments.py b/files/routes/comments.py index e1000cdb8..b41df7836 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -654,6 +654,9 @@ def edit_comment(cid, v): c = get_comment(cid, v=v) + if time.time() - c.created_utc > 7*24*60*60: + return {"error":"You can't edit comments older than 1 week!"}, 403 + if c.author_id != v.id: abort(403) body = request.values.get("body", "").strip()[:10000] diff --git a/files/routes/posts.py b/files/routes/posts.py index 0d6bc28e4..e9d916b3b 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -440,6 +440,9 @@ def morecomments(v, cid): def edit_post(pid, v): p = get_post(pid) + if time.time() - p.created_utc > 7*24*60*60: + return {"error":"You can't edit posts older than 1 week!"}, 403 + if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403) title = request.values.get("title", "").strip().replace('‎','')