From 12e35f26d234382044a63ae0b3db4ce13414c228 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 10 Dec 2021 21:53:16 +0200 Subject: [PATCH] fsddfs --- files/routes/comments.py | 3 +++ files/routes/posts.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/files/routes/comments.py b/files/routes/comments.py index 633544e424..9ec1fdc24e 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -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 != "": diff --git a/files/routes/posts.py b/files/routes/posts.py index bbbe5e26c9..984ce52730 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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