vvvvvvvvvvvvvvv
This commit is contained in:
parent
46f29624cb
commit
09fe6f5a07
8 changed files with 30 additions and 30 deletions
|
@ -407,10 +407,10 @@ def edit_post(pid, v):
|
|||
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
|
||||
|
||||
if v.marseyawarded:
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title))
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title, flags=re.A))
|
||||
if len(marregex) == 0: return {"error":"You can only type marseys!"}, 403
|
||||
if body:
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", body))
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", body, flags=re.A))
|
||||
if len(marregex) == 0: 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
|
||||
|
@ -420,7 +420,7 @@ def edit_post(pid, v):
|
|||
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
|
||||
|
||||
title_html = filter_emojis_only(title, edit=True)
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))): return {"error":"You can only type marseys!"}, 403
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html, flags=re.A))): return {"error":"You can only type marseys!"}, 403
|
||||
p.title = title[:500]
|
||||
p.title_html = title_html
|
||||
|
||||
|
@ -447,7 +447,7 @@ def edit_post(pid, v):
|
|||
if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
|
||||
|
||||
if not p.options.count():
|
||||
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body):
|
||||
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body, flags=re.A):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOPOLLER_ID,
|
||||
parent_submission=p.id,
|
||||
|
@ -470,7 +470,7 @@ def edit_post(pid, v):
|
|||
return {"error": reason}, 403
|
||||
|
||||
p.body = body
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))): return {"error":"You can only type marseys!"}, 40
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, flags=re.A))): return {"error":"You can only type marseys!"}, 40
|
||||
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
|
@ -682,7 +682,7 @@ def submit_post(v):
|
|||
title_html = filter_emojis_only(title)
|
||||
body = request.values.get("body", "").strip().replace('','')
|
||||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))): return {"error":"You can only type marseys!"}, 40
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html, flags=re.A))): return {"error":"You can only type marseys!"}, 40
|
||||
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
|
@ -770,10 +770,10 @@ def submit_post(v):
|
|||
else: render_template("submit.html", v=v, error="500 character limit for titles.", title=title[:500], url=url, body=request.values.get("body", "")), 400
|
||||
|
||||
if v.marseyawarded:
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title))
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title, flags=re.A))
|
||||
if len(marregex) == 0: return {"error":"You can only type marseys!"}, 403
|
||||
if body:
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", body))
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", body, flags=re.A))
|
||||
if len(marregex) == 0: 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
|
||||
|
@ -848,12 +848,12 @@ def submit_post(v):
|
|||
|
||||
if v and v.admin_level > 2:
|
||||
bet_options = []
|
||||
for i in re.finditer('\s*\$\$\$([^\$\n]+)\$\$\$\s*', body):
|
||||
for i in re.finditer('\s*\$\$\$([^\$\n]+)\$\$\$\s*', body, flags=re.A):
|
||||
bet_options.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
options = []
|
||||
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body):
|
||||
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body, flags=re.A):
|
||||
options.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
|
@ -878,7 +878,7 @@ def submit_post(v):
|
|||
|
||||
body_html = sanitize(body)
|
||||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))): return {"error":"You can only type marseys!"}, 400
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, flags=re.A))): return {"error":"You can only type marseys!"}, 400
|
||||
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue