From 0af46237f6fc54fe9538e2a5189171fd04c5d0c2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 22 May 2022 12:26:59 +0200 Subject: [PATCH] stripper --- files/routes/comments.py | 5 ++++- files/routes/posts.py | 4 ++++ files/routes/settings.py | 4 +++- snappy_rDrama.txt | 2 -- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 2773812b4..773320da9 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -320,11 +320,12 @@ def api_comment(v): body += f"\n\n{url}" else: return {"error": "Image/Video files only"}, 400 + body = body.strip() + if v.admin_level > 2 and parent_post.id == 37749 and level == 1: with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f: f.write('\n{[para]}\n' + body) - if v.agendaposter and not v.marseyawarded and parent_post.id not in ADMIGGERS: body = torture_ap(body, v.username) @@ -785,6 +786,8 @@ def edit_comment(cid, v): body += f"\n\n{url}" else: return {"error": "Image/Video files only"}, 400 + body = body.strip() + body_html = sanitize(body, edit=True) if len(body_html) > 20000: abort(400) diff --git a/files/routes/posts.py b/files/routes/posts.py index c10ebd68d..be7b5b082 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -477,6 +477,8 @@ def edit_post(pid, v): body += f"\n\n{url}" else: return {"error": "Image/Video files only"}, 400 + body = body.strip() + if body != p.body: if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username) @@ -1095,6 +1097,8 @@ def submit_post(v, sub=None): else: return error("Image/Video files only.") + body = body.strip() + body_html = sanitize(body) if v.marseyawarded and marseyaward_body_regex.search(body_html): diff --git a/files/routes/settings.py b/files/routes/settings.py index 8a9157635..04534cae8 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -231,7 +231,9 @@ def settings_profile_post(v): else: if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "Image/Video files only"}, 400 return render_template("settings_profile.html", v=v, error="Image/Video files only."), 400 - + + bio = bio.strip() + bio_html = sanitize(bio) if len(bio_html) > 10000: diff --git a/snappy_rDrama.txt b/snappy_rDrama.txt index 28e1affbd..99eef4e9f 100644 --- a/snappy_rDrama.txt +++ b/snappy_rDrama.txt @@ -3815,6 +3815,4 @@ This is your fate. This is what you chose. There is no turning back. You are the {[para]} #fortune {[para]} - - ![](/images/16532150566811156.webp) \ No newline at end of file