bbb
This commit is contained in:
parent
e763df55cd
commit
19f07b7a99
3 changed files with 14 additions and 14 deletions
|
@ -136,8 +136,8 @@ def api_comment(v):
|
||||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||||
|
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
parent_submission = request.values.get("submission").strip()
|
parent_submission = request.values.get("submission").strip()
|
||||||
parent_fullname = request.values.get("parent_fullname").strip()
|
parent_fullname = request.values.get("parent_fullname").strip()
|
||||||
|
@ -537,8 +537,8 @@ def api_comment(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def edit_comment(cid, v):
|
def edit_comment(cid, v):
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
c = get_comment(cid, v=v)
|
c = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
|
|
@ -388,8 +388,8 @@ def morecomments(v, cid):
|
||||||
@auth_required
|
@auth_required
|
||||||
def edit_post(pid, v):
|
def edit_post(pid, v):
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
p = get_post(pid)
|
p = get_post(pid)
|
||||||
|
|
||||||
|
@ -687,8 +687,8 @@ def submit_post(v):
|
||||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||||
|
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error": "Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error": "Max file size is 4 MB."}
|
||||||
|
|
||||||
|
|
||||||
title = request.values.get("title", "").strip()[:500].replace('','')
|
title = request.values.get("title", "").strip()[:500].replace('','')
|
||||||
|
|
|
@ -47,8 +47,8 @@ def removebackground(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def settings_profile_post(v):
|
def settings_profile_post(v):
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
|
|
||||||
updated = False
|
updated = False
|
||||||
|
@ -620,8 +620,8 @@ def settings_log_out_others(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def settings_images_profile(v):
|
def settings_images_profile(v):
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403
|
if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403
|
||||||
|
|
||||||
|
@ -655,8 +655,8 @@ def settings_images_profile(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def settings_images_banner(v):
|
def settings_images_banner(v):
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
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."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}
|
||||||
|
|
||||||
if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403
|
if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue