diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index a4dcadde37..a80475ea00 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -337,7 +337,7 @@ def handle_youtube_links(url): return html @with_sigalrm_timeout(10) -def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_emojis=False, snappy=False, chat=False, blackjack=None): +def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis=False, snappy=False, chat=False, blackjack=None): sanitized = sanitized.strip() if not sanitized: return '' diff --git a/files/routes/admin.py b/files/routes/admin.py index d74582d0f8..33b0997785 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -84,7 +84,7 @@ def edit_rules_get(v): @admin_level_required(PERMS['EDIT_RULES']) def edit_rules_post(v): rules = request.values.get('rules', '').strip() - rules = sanitize(rules, blackjack="rules", showmore=False) + rules = sanitize(rules, blackjack="rules") with open(f'files/templates/rules_{SITE_NAME}.html', 'w+', encoding="utf-8") as f: f.write(rules) diff --git a/files/routes/awards.py b/files/routes/awards.py index ae0483a2db..fc005116c5 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -439,7 +439,7 @@ def award_thing(v, thing_type, id): body = thing.body if author.owoify: body = owoify(body) body = marsify(body) - thing.body_html = sanitize(body, limit_pings=5) + thing.body_html = sanitize(body, limit_pings=5, showmore=True) g.db.add(thing) elif "Vampire" in kind and kind == v.house: if author.bite: author.bite += 172800 @@ -465,7 +465,7 @@ def award_thing(v, thing_type, id): body = thing.body body = owoify(body) if author.marsify: body = marsify(body) - thing.body_html = sanitize(body, limit_pings=5) + thing.body_html = sanitize(body, limit_pings=5, showmore=True) g.db.add(thing) elif ("Femboy" in kind and kind == v.house) or kind == 'rainbow': if author.rainbow: author.rainbow += 86400 diff --git a/files/routes/comments.py b/files/routes/comments.py index 08aaf833f6..3c3dae2d9c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -240,7 +240,7 @@ def comment(v:User): if v.owoify: body_for_sanitize = owoify(body_for_sanitize) if v.marsify: body_for_sanitize = marsify(body_for_sanitize) - body_html = sanitize(body_for_sanitize, limit_pings=5, count_emojis=not v.marsify) + body_html = sanitize(body_for_sanitize, limit_pings=5, showmore=True, count_emojis=not v.marsify) if post_target.id not in ADMIGGER_THREADS and not (v.agendaposter and v.agendaposter_phrase in body.lower()): existing = g.db.query(Comment.id).filter( @@ -629,7 +629,7 @@ def edit_comment(cid, v): if v.marsify: body_for_sanitize = marsify(body_for_sanitize) - body_html = sanitize(body_for_sanitize, golden=False, limit_pings=5) + body_html = sanitize(body_for_sanitize, golden=False, limit_pings=5, showmore=True) if len(body_html) > COMMENT_BODY_HTML_LENGTH_LIMIT: abort(400) diff --git a/files/routes/posts.py b/files/routes/posts.py index d33b53eb1f..9c3c85a1f5 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -574,7 +574,7 @@ def submit_post(v:User, sub=None): body = process_files(request.files, v, body) body = body.strip()[:POST_BODY_LENGTH_LIMIT(v)] # process_files() adds content to the body, so we need to re-strip - body_html = sanitize(body, count_emojis=True, limit_pings=100, showmore=False) + body_html = sanitize(body, count_emojis=True, limit_pings=100) if v.marseyawarded and marseyaward_body_regex.search(body_html): abort(400, "You can only type marseys!") @@ -1040,7 +1040,7 @@ def edit_post(pid, v): body = body.strip()[:POST_BODY_LENGTH_LIMIT(v)] # process_files() may be adding stuff to the body if body != p.body: - body_html = sanitize(body, golden=False, limit_pings=100, showmore=False) + body_html = sanitize(body, golden=False, limit_pings=100) if v.id == p.author_id and v.marseyawarded and marseyaward_body_regex.search(body_html): abort(403, "You can only type marseys!") diff --git a/files/routes/subs.py b/files/routes/subs.py index 6981716bd7..a0d99896e8 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -455,7 +455,7 @@ def post_sub_sidebar(v:User, sub): if v.shadowbanned: return redirect(f'/h/{sub}/settings') sub.sidebar = request.values.get('sidebar', '').strip()[:10000] - sub.sidebar_html = sanitize(sub.sidebar, blackjack=f"/h/{sub} sidebar", showmore=False) + sub.sidebar_html = sanitize(sub.sidebar, blackjack=f"/h/{sub} sidebar") if len(sub.sidebar_html) > 20000: abort(400, "Sidebar is too big!") g.db.add(sub)