vvvvvvvvvvvvvvv

This commit is contained in:
Aevann1 2022-01-27 19:04:02 +02:00
parent 46f29624cb
commit 09fe6f5a07
8 changed files with 30 additions and 30 deletions

View file

@ -164,7 +164,7 @@ def api_comment(v):
f.write('\n{[para]}\n' + body)
if v.marseyawarded:
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
@ -176,7 +176,7 @@ def api_comment(v):
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})')
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), "")
@ -240,7 +240,7 @@ def api_comment(v):
body_html = sanitize(body, comment=True)
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))): return {"error":"You can only type marseys!"}, 403
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, flags=re.A))): return {"error":"You can only type marseys!"}, 403
if v.longpost:
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
@ -604,7 +604,7 @@ def edit_comment(cid, v):
if body != c.body or request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
if v.marseyawarded:
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
@ -616,7 +616,7 @@ def edit_comment(cid, v):
if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
if not c.options:
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_option = Comment(author_id=AUTOPOLLER_ID,
parent_submission=c.parent_submission,
@ -630,7 +630,7 @@ def edit_comment(cid, v):
body_html = sanitize(body, edit=True)
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))): return {"error":"You can only type marseys!"}, 403
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, flags=re.A))): return {"error":"You can only type marseys!"}, 403
if v.longpost:
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403