Discord changed their username scheme & still conflicts

pull/175/head
sighup 2023-08-03 01:43:06 -05:00
parent 06b01db860
commit 914c73a04e
2 changed files with 8 additions and 3 deletions

View File

@ -224,8 +224,6 @@ def command_regex_matcher(match, upper=False):
reason_regex_post = re.compile('(/post/[0-9]+)', flags=re.A)
reason_regex_comment = re.compile('(/comment/[0-9]+)', flags=re.A)
discord_username_regex = re.compile("(\s|^|>).{2,32}#[0-9]{4}(?=[^0-9]|$)", flags=re.A)
numbered_list_regex = re.compile('((\s|^)[0-9]+)\. ', flags=re.A)
image_link_regex = re.compile(f"https://(i\.)?{SITE}\/(chat_)?images\/[0-9]{{11,17}}r?\.webp", flags=re.A)

View File

@ -580,7 +580,14 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
link["rel"] = "nofollow noopener"
sanitized = str(soup).replace('<html><body>','').replace('</body></html>','').replace('/>','>')
sanitized = str(soup).replace('<html><body>','').replace('</body></html>','')
def error(error):
if chat:
return error, 403
else:
abort(403, error)
if '<pre>' not in sanitized and blackjack != "rules":
sanitized = sanitized.replace('\n','')