From 9a23c195ed28cbb10628961481b28f524adf1fd7 Mon Sep 17 00:00:00 2001 From: TLSM Date: Fri, 20 May 2022 18:49:00 -0400 Subject: [PATCH] Fix overpermissive email regex. --- files/helpers/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 202f72989..9ce6daf06 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -824,7 +824,7 @@ emoji_regex3 = re.compile(f"(?([\w:~,()\-.#&\/=?@%;+]{5,250})<\/a>', flags=re.A) -email_regex = re.compile('[^@]+@[^@]+\.[^@]+', flags=re.A) +email_regex = re.compile('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}', flags=re.A|re.I) utm_regex = re.compile('utm_[a-z]+=[a-z0-9_]+&', flags=re.A) utm_regex2 = re.compile('[?&]utm_[a-z]+=[a-z0-9_]+', flags=re.A)