diff --git a/files/routes/comments.py b/files/routes/comments.py index 633544e42..9ec1fdc24 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 bbbe5e26c..984ce5273 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