From 33ceccab7b8f449493c488af6ae9dac6f96935e5 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 27 Jul 2023 18:41:39 +0300 Subject: [PATCH] fix https://media.discordapp.net/attachments/1104920967949586472/1134144475082543164/IMG_7559.png?width=282&height=611 --- files/helpers/alerts.py | 2 +- files/helpers/sanitize.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index c40a0f3cb..f607efc67 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -97,7 +97,7 @@ def notif_comment2(p): if existing: return existing[0], text else: if p.sub: text += f" in /h/{p.sub}" - text_html = sanitize(text, blackjack="notification") + text_html = sanitize(text, blackjack="notification", post_mention_notif=True) return create_comment(text_html), text diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index c60e9ffe3..3e70f5a1a 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -357,7 +357,7 @@ def handle_youtube_links(url): return html @with_sigalrm_timeout(10) -def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis=False, snappy=False, chat=False, blackjack=None): +def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis=False, snappy=False, chat=False, blackjack=None, post_mention_notif=False): def error(error): if chat: return error, 403 @@ -588,7 +588,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis continue #don't allow something like this [https://rԁrama.net/leaderboard](https://iplogger.org/1fRKk7) - if not snappy: + if not snappy and not post_mention_notif: string_domain = tldextract.extract(str(link.string)).registered_domain if string_domain and string_domain != tldextract.extract(href).registered_domain: link.string = href