diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 6a16f42d63..b8b0ecb94f 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -214,7 +214,7 @@ def with_sigalrm_timeout(timeout: int): @with_sigalrm_timeout(2) -def sanitize(sanitized, edit=False, limit_pings=False): +def sanitize(sanitized, edit=False, limit_pings=False, showmore=True): sanitized = sanitized.strip() sanitized = normalize_url(sanitized) @@ -388,7 +388,7 @@ def sanitize(sanitized, edit=False, limit_pings=False): if '
' not in sanitized: sanitized = sanitized.replace('\n','') - if len(sanitized) > 5000: + if showmore and len(sanitized) > 5000: sanitized = showmore_regex.sub(r'\1\2 ', sanitized) return sanitized.strip() diff --git a/files/routes/posts.py b/files/routes/posts.py index 11f0fc7573..2a5a4efc16 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -439,7 +439,7 @@ def edit_post(pid, v): g.db.add(option) - body_html = sanitize(body, edit=True, limit_pings=True) + body_html = sanitize(body, edit=True, limit_pings=True, showmore=False) if v.id == p.author_id and v.marseyawarded and marseyaward_body_regex.search(body_html): return {"error":"You can only type marseys!"}, 403 @@ -890,7 +890,7 @@ def submit_post(v, sub=None): body = body.strip() - body_html = sanitize(body, limit_pings=True) + body_html = sanitize(body, limit_pings=True, showmore=False) if v.marseyawarded and marseyaward_body_regex.search(body_html): return error("You can only type marseys!")