fixed king
This commit is contained in:
parent
c0e12266c1
commit
32c1544d98
4 changed files with 20 additions and 37 deletions
|
@ -213,9 +213,11 @@ def api_comment(v):
|
|||
if v.marseyawarded and parent_post.id not in (37696,37697,37749,37833,37838):
|
||||
if not marsey_regex.fullmatch(body): return {"error":"You can only type marseys!"}, 403
|
||||
|
||||
if v.longpost and len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird and len(body) > 140 and parent_post.id not in (37696,37697,37749,37833,37838):
|
||||
return {"error":"You have to type less than 140 characters!"}, 403
|
||||
if parent_post.id not in (37696,37697,37749,37833,37838):
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
||||
return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird and len(body) > 140:
|
||||
return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400
|
||||
|
||||
|
@ -339,13 +341,6 @@ def api_comment(v):
|
|||
|
||||
body_html = sanitize(body, comment=True)
|
||||
|
||||
if parent_post.id not in (37696,37697,37749,37833,37838):
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('):
|
||||
return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
|
||||
if bans:
|
||||
|
@ -725,8 +720,10 @@ def edit_comment(cid, v):
|
|||
if v.marseyawarded and not marsey_regex.fullmatch(body):
|
||||
return {"error":"You can only type marseys!"}, 403
|
||||
|
||||
if v.longpost and len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird and len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
||||
return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird and len(body) > 140:
|
||||
return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
body = image_regex.sub(r'', body)
|
||||
|
||||
|
@ -761,11 +758,6 @@ def edit_comment(cid, v):
|
|||
|
||||
body_html = sanitize(body, edit=True)
|
||||
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
|
||||
if bans:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue