From bb87673a905187e06c3a7899b23f53eeeb4fb4c6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 18 Sep 2023 19:28:08 +0300 Subject: [PATCH] restore transform without "scale" --- files/helpers/sanitize.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index c8c6922e2..fed5f0d40 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -53,11 +53,14 @@ TLDS = ( # Original gTLDs and ccTLDs allowed_tags = ('a','audio','b','big','blockquote','br','center','code','del','details','em','g','h1','h2','h3','h4','h5','h6','hr','i','img','li','lite-youtube','marquee','ol','p','pre','rp','rt','ruby','small','span','spoiler','strike','strong','sub','summary','sup','table','tbody','td','th','thead','tr','u','ul','video') -allowed_styles = ['background-color', 'color', 'filter', 'font-weight', 'text-align'] +allowed_styles = ['background-color', 'color', 'filter', 'font-weight', 'text-align', 'transform'] def allowed_attributes(tag, name, value): - if name == 'style': return True + if name == 'style': + if 'transform' in value.lower() and 'scale' in value.lower(): + return False + return True if tag == 'marquee': if name in {'direction', 'behavior', 'scrollamount'}: return True