forked from MarseyWorld/MarseyWorld
fix overflow bug
parent
36862484c1
commit
0ef1a9c856
|
@ -265,14 +265,14 @@ 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", "")
|
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r","").replace("\n", "").replace("𒐫", "")
|
||||||
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")
|
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n").replace("𒐫", "")
|
||||||
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