From ad0c050cc35c865563f552c8d6ce2dd2916d3347 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 18 Apr 2022 00:31:39 +0200 Subject: [PATCH] fdsfd --- files/helpers/const.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index b700a8407e..5f347fbabf 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -681,7 +681,7 @@ marsey_regex = re.compile("[a-z0-9]{1,30}", flags=re.A) tags_regex = re.compile("[a-z0-9: ]{1,200}", flags=re.A) -image_regex = re.compile("(^https:\/\/[\w\-.#&/=\?@%;+]{5,250}\.(png|jpg|jpeg|gif|webp|maxwidth=9999|fidelity=high)($|\s))", flags=re.I|re.M|re.A) +image_regex = re.compile("(^https:\/\/[\w\-.#&/=\?@%;+]{5,250}(\.png|\.jpg|\.jpeg|\.gif|\.webp|maxwidth=9999|fidelity=high)($|\s))", flags=re.I|re.M|re.A) valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,20}$", flags=re.A) @@ -810,8 +810,8 @@ approved_embed_hosts = [ hosts = "|".join(approved_embed_hosts).replace('.','\.') -image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]\.)*({hosts}))?\/).*?)\)', flags=re.A) +image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/).*?)\)', flags=re.A) -embed_check_regex = regex.compile(f'(?)(https:\/\/([a-z0-9-]\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*', flags=regex.A) +embed_check_regex = regex.compile(f'(?)(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*', flags=regex.A) -video_regex = regex.compile(f'((?)(https:\/\/([a-z0-9-]\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=regex.A) \ No newline at end of file +video_regex = regex.compile(f'((?)(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=regex.A) \ No newline at end of file