From c2701b2aeba5811a8c40b70bf24a836fdd327469 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 12 Aug 2023 14:00:52 +0300 Subject: [PATCH] fix this https://fsdfsd.net/rDrama/rDrama/issues/192 --- files/helpers/sanitize.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 16d9365a3..a1225a23b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -358,7 +358,7 @@ def with_sigalrm_timeout(timeout): def remove_cuniform(sanitized): if not sanitized: return "" - sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace('\u202e','').replace("\ufeff", "") + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace('\u202e','').replace("\ufeff", "").replace("\u033f","").replace("\u0589", ":") sanitized = sanitized.replace("𒐪","").replace("𒐫","").replace("﷽","") sanitized = sanitized.replace("\r\n", "\n") sanitized = sanitized.replace("’", "'") @@ -422,10 +422,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis if ping_group_count > 5: error("You can only ping a maximum of 5 ping groups!") - if "style" in sanitized and "filter" in sanitized: - if sanitized.count("blur(") + sanitized.count("drop-shadow(") > 5: - error("Too many filters!") - if blackjack and execute_blackjack(g.v, None, sanitized, blackjack): sanitized = 'g' @@ -450,9 +446,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis sanitized = sanitized.replace('/\1', sanitized) sanitized = sub_regex.sub(r'/\1', sanitized) @@ -674,6 +667,10 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis if pos >= 0: sanitized = (sanitized[:pos] + showmore_regex.sub(r'\1

\2', sanitized[pos:], count=1)) + if "style" in sanitized and "filter" in sanitized: + if sanitized.count("blur(") + sanitized.count("drop-shadow(") > 5: + error("Too many filters!") + return sanitized.strip() def allowed_attributes_emojis(tag, name, value):