From e0d9ef6094e8d817969b027c4c674a1ef4301242 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 12 Jan 2022 05:28:49 +0200 Subject: [PATCH] bb --- files/helpers/sanitize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 058dedb86..7b2364987 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -109,7 +109,7 @@ def sanitize(sanitized, noimages=False, alert=False): for i in re.finditer("

@((\w|-){1,25})", sanitized): u = get_user(i.group(1), graceful=True) if u: - sanitized = re.sub("

@((\w|-){1,25})", f'

@{u.username}', sanitized) + sanitized = sanitized.replace(i.group(0), f'

@{u.username}') else: sanitized = re.sub('(^|\s|\n|

)\/?((r|u)\/\w{3,25})', r'\1\2', sanitized) @@ -118,9 +118,9 @@ def sanitize(sanitized, noimages=False, alert=False): if u and (not g.v.any_block_exists(u) or g.v.admin_level > 1): if noimages: - sanitized = re.sub("(^|\s|\n|

)@((\w|-){1,25})", rf'\1@{u.username}', sanitized) + sanitized = sanitized.replace(i.group(0), f'{i.group(1)}@{u.username}') else: - sanitized = re.sub("(^|\s|\n|

)@((\w|-){1,25})", rf'\1@{u.username}', sanitized) + sanitized = sanitized.replace(i.group(0), f'{i.group(1)}@{u.username}') for i in re.finditer('https://i\.imgur\.com/(([^_]*?)\.(jpg|png|jpeg))', sanitized):