From 0ef1a9c85604b5f9b75431b214a6fbaa51f8c3df Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 16 Mar 2023 12:24:20 +0200 Subject: [PATCH] fix overflow bug --- files/helpers/sanitize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index a83004b41..09e505bd6 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -265,14 +265,14 @@ def with_sigalrm_timeout(timeout: int): def sanitize_raw_title(sanitized:Optional[str]) -> str: if not sanitized: return "" - sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r","").replace("\n", "") + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r","").replace("\n", "").replace("𒐫", "") sanitized = sanitized.strip() return sanitized[:POST_TITLE_LENGTH_LIMIT] def sanitize_raw_body(sanitized:Optional[str], is_post:bool) -> str: if not sanitized: return "" sanitized = html_comment_regex.sub('', sanitized) - sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n") + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n").replace("𒐫", "") sanitized = sanitized.strip() return sanitized[:POST_BODY_LENGTH_LIMIT(g.v) if is_post else COMMENT_BODY_LENGTH_LIMIT]