This commit is contained in:
Aevann1 2021-12-10 21:39:48 +02:00
parent 7fe7d9c9ca
commit 28faec1a38
3 changed files with 18 additions and 10 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 != "":