master
Aevann1 2021-08-19 18:10:44 +02:00
parent 6d324f27aa
commit 62e5388eff
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ def api_flag_post(pid, v):
if existing: return "", 409 if existing: return "", 409
reason = request.form.get("reason", "").strip()[:100] reason = request.form.get("reason", "").strip()[:100]
if "<" in reason: return {"error": f"Reasons can't contain <"}
for i in re.finditer(':(.{1,30}?):', reason): for i in re.finditer(':(.{1,30}?):', reason):
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'):
@ -45,6 +46,7 @@ def api_flag_comment(cid, v):
if existing: return "", 409 if existing: return "", 409
reason = request.form.get("reason", "").strip()[:100] reason = request.form.get("reason", "").strip()[:100]
if "<" in reason: return {"error": f"Reasons can't contain <"}
for i in re.finditer(':(.{1,30}?):', reason): for i in re.finditer(':(.{1,30}?):', reason):
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'):