From 3ee1851fa69f91438c59770d0615149eba6cb97c Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 24 Mar 2023 13:43:15 +0200 Subject: [PATCH] fix this https://rdrama.net/h/changelog/post/157290/rdramanet-is-proud-to-welcome-the/3852530#context --- files/helpers/sanitize.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d6135d5ee..62b32c2d2 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -265,14 +265,16 @@ 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", "").replace("𒐫", "") + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r","").replace("\n", "").replace("𒐫", "").replace('\u202e','') 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").replace("𒐫", "") + + print(sanitized, flush=True) + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n").replace("𒐫", "").replace('\u202e','') sanitized = sanitized.strip() return sanitized[:POST_BODY_LENGTH_LIMIT(g.v) if is_post else COMMENT_BODY_LENGTH_LIMIT]