This commit is contained in:
Aevann1 2022-02-24 05:46:09 +02:00
parent 7b4d3a7b8f
commit 043b822b3e
2 changed files with 17 additions and 12 deletions

View file

@ -145,9 +145,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
def api_comment(v):
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413
if v.admin_level < 2:
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
parent_submission = request.values.get("submission").strip()
parent_fullname = request.values.get("parent_fullname").strip()
@ -693,9 +694,11 @@ def api_comment(v):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
def edit_comment(cid, v):
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413
if v.admin_level < 2:
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
c = get_comment(cid, v=v)