remotes/1693045480750635534/spooky-22
Aevann1 2021-12-10 21:39:48 +02:00
parent 987a2fde08
commit d7a34752e1
2 changed files with 18 additions and 6 deletions

View File

@ -157,7 +157,9 @@ def api_comment(v):
else: top_comment_id = parent.top_comment_id
else: abort(400)
body = request.values.get("body", "").strip()[:10000]
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())
if v.marseyawarded:
if time.time() > v.marseyawarded:
@ -615,7 +617,9 @@ def edit_comment(cid, v):
if c.is_banned or c.deleted_utc > 0: abort(403)
body = request.values.get("body", "").strip()[:10000]
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())
if len(body) < 1: return {"error":"You have to actually type something!"}, 400
if body != c.body and body != "":

View File

@ -335,8 +335,12 @@ def edit_post(pid, v):
if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403)
title = request.values.get("title", "").strip()
body = request.values.get("body", "").strip()
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())
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())
if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403
@ -669,7 +673,9 @@ def submit_post(v):
if request.content_length > 8 * 1024 * 1024: return "Max file size is 8 MB.", 413
elif request.content_length > 4 * 1024 * 1024: return "Max file size is 4 MB.", 413
title = request.values.get("title", "").strip()[:500]
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())
url = request.values.get("url", "").strip()
if v.agendaposter and not v.marseyawarded:
@ -678,7 +684,9 @@ def submit_post(v):
title = censor_slurs2(title).upper().replace(' ME ', f' @{v.username} ')
title_html = filter_emojis_only(title)
body = request.values.get("body", "").strip()
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())
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40