remotes/1693045480750635534/spooky-22
Aevann1 2022-02-24 05:46:09 +02:00
parent 791fff3d37
commit 57f989dfe7
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)

View File

@ -444,9 +444,10 @@ def morecomments(v, cid):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
def edit_post(pid, 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
p = get_post(pid)
@ -875,9 +876,10 @@ def submit_post(v, sub=None):
if v.is_suspended: return error("You can't perform this action while banned.")
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return error( "Max file size is 8 MB.")
elif request.content_length > 4 * 1024 * 1024: return error( "Max file size is 4 MB.")
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).")
elif request.content_length > 4 * 1024 * 1024: return error( "Max file size is 4 MB (8 MB for paypigs).")
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)