From dd5eb74924e2dcd320536894d73cf89705e58790 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 18:22:25 +0200 Subject: [PATCH] fdssdf --- files/routes/comments.py | 10 ++-------- files/routes/posts.py | 14 ++++---------- files/templates/authforms.html | 2 +- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- 11 files changed, 19 insertions(+), 31 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 0c58cb769..522d9601a 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -157,10 +157,7 @@ def api_comment(v): else: top_comment_id = parent.top_comment_id else: abort(400) - 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') + body = request.values.get("body", "").strip()[:10000] if v.marseyawarded: if time.time() > v.marseyawarded: @@ -618,10 +615,7 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) - 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') + body = request.values.get("body", "").strip()[:10000] if len(body) < 1: return {"error":"You have to actually type something!"}, 400 diff --git a/files/routes/posts.py b/files/routes/posts.py index 438a21ac4..00c6a346a 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -379,12 +379,9 @@ 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().upper() + title = request.values.get("title", "").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()) - body = body.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n') + body = request.values.get("body", "").strip() if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403 @@ -717,7 +714,7 @@ 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].upper() + title = request.values.get("title", "").strip()[:500] url = request.values.get("url", "").strip() @@ -727,10 +724,7 @@ 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().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') + body = request.values.get("body", "").strip() if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40 diff --git a/files/templates/authforms.html b/files/templates/authforms.html index b0345d648..a55eb2d02 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -14,7 +14,7 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} diff --git a/files/templates/default.html b/files/templates/default.html index d45c7b586..a84bf0159 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -6,12 +6,12 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 472d39ec0..0df600d46 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,11 +6,11 @@ {% block content %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 7f6360190..c9383df84 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 592c50d9c..4a196c463 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -33,7 +33,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 8b2088c04..4ebd33b42 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -38,10 +38,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 5e2d3f269..20921b2f8 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -30,7 +30,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 1d2cb9941..908510585 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 1492e328d..acbc5de0e 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %}