forked from MarseyWorld/MarseyWorld
fix this https://rdrama.net/h/changelog/post/157290/rdramanet-is-proud-to-welcome-the/3852530#context
parent
09fce36d15
commit
3ee1851fa6
|
@ -265,14 +265,16 @@ def with_sigalrm_timeout(timeout: int):
|
||||||
|
|
||||||
def sanitize_raw_title(sanitized:Optional[str]) -> str:
|
def sanitize_raw_title(sanitized:Optional[str]) -> str:
|
||||||
if not sanitized: return ""
|
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()
|
sanitized = sanitized.strip()
|
||||||
return sanitized[:POST_TITLE_LENGTH_LIMIT]
|
return sanitized[:POST_TITLE_LENGTH_LIMIT]
|
||||||
|
|
||||||
def sanitize_raw_body(sanitized:Optional[str], is_post:bool) -> str:
|
def sanitize_raw_body(sanitized:Optional[str], is_post:bool) -> str:
|
||||||
if not sanitized: return ""
|
if not sanitized: return ""
|
||||||
sanitized = html_comment_regex.sub('', sanitized)
|
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()
|
sanitized = sanitized.strip()
|
||||||
return sanitized[:POST_BODY_LENGTH_LIMIT(g.v) if is_post else COMMENT_BODY_LENGTH_LIMIT]
|
return sanitized[:POST_BODY_LENGTH_LIMIT(g.v) if is_post else COMMENT_BODY_LENGTH_LIMIT]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue