From c7d3401b629e831b656d4d7969831d6288bc4e9f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 18 Apr 2022 00:47:30 +0200 Subject: [PATCH] fds --- files/classes/user.py | 15 --------------- files/helpers/const.py | 6 +++--- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index bd18eea2c..c65f351b5 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -573,21 +573,6 @@ class User(Base): return data - def deletepfp(self): - if self.highres and '/images/' in self.highres: - image = '/images/' + self.highres.split('/images/')[1] - if path.exists(image): remove(image) - if self.profileurl and '/images/' in self.profileurl: - image = '/images/' + self.profileurl.split('/images/')[1] - if path.exists(image): remove(image) - self.highres = None - self.profileurl = None - - def deletebanner(self): - if self.bannerurl and '/images/' in self.bannerurl: - image = '/images/' + self.bannerurl.split('/images/')[1] - if path.exists(image): remove(image) - self.bannerurl = None def ban(self, admin=None, reason=None, days=0): if days: diff --git a/files/helpers/const.py b/files/helpers/const.py index 5f347fbab..64792560f 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -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