master
Aevann1 2021-12-10 21:53:16 +02:00
parent 7501c3818e
commit 12e35f26d2
2 changed files with 9 additions and 0 deletions

View File

@ -160,6 +160,7 @@ def api_comment(v):
body = request.values.get("body", "").strip()[:10000].replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', body):
body = body.replace(i.group(2), i.group(2).upper())
body = body.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
if v.marseyawarded:
if time.time() > v.marseyawarded:
@ -620,6 +621,8 @@ def edit_comment(cid, v):
body = request.values.get("body", "").strip()[:10000].replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', body):
body = body.replace(i.group(2), i.group(2).upper())
body = body.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
if len(body) < 1: return {"error":"You have to actually type something!"}, 400
if body != c.body and body != "":

View File

@ -338,9 +338,12 @@ def edit_post(pid, v):
title = request.values.get("title", "").strip().replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', title):
title = title.replace(i.group(2), i.group(2).upper())
title = title.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
body = request.values.get("body", "").strip().replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', body):
body = body.replace(i.group(2), i.group(2).upper())
body = body.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403
@ -676,6 +679,8 @@ def submit_post(v):
title = request.values.get("title", "").strip()[:500].replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', title):
title = title.replace(i.group(2), i.group(2).upper())
title = title.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
url = request.values.get("url", "").strip()
if v.agendaposter and not v.marseyawarded:
@ -687,6 +692,7 @@ def submit_post(v):
body = request.values.get("body", "").strip().replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', body):
body = body.replace(i.group(2), i.group(2).upper())
body = body.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40