From e42227ab679c47fa06a09db4b5fcaaf529a92399 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 23 Jun 2022 02:34:37 +0200 Subject: [PATCH] add glowie marseys --- files/helpers/sanitize.py | 8 +++++--- files/templates/header.html | 2 +- files/templates/util/assetcache.html | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 77b258926..1199eb136 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -65,7 +65,7 @@ def allowed_attributes(tag, name, value): if name in ['src','data-src']: return is_safe_url(value) if name == 'loading' and value == 'lazy': return True if name == 'data-bs-toggle' and value == 'tooltip': return True - if name in ['g','b'] and not value: return True + if name in ['g','b','glow'] and not value: return True if name in ['alt','title']: return True if name == 'referrpolicy' and value == 'no-referrer': return True return False @@ -136,7 +136,9 @@ def render_emoji(html, regexp, edit, marseys_used, b=False): emoji = i.group(1).lower() attrs = '' if b: attrs += ' b' - if not edit and len(emojis) <= 20 and random() < 0.0025 and ('marsey' in emoji or emoji in marseys_const2): attrs += ' g' + if not edit and len(emojis) <= 20 and ('marsey' in emoji or emoji in marseys_const2): + if random() < 0.0025: attrs += ' g' + elif random() < 0.00125: attrs += ' glow' old = emoji emoji = emoji.replace('!','').replace('#','') @@ -345,7 +347,7 @@ def allowed_attributes_emojis(tag, name, value): if name == 'src' and value.startswith('/') and '\\' not in value: return True if name == 'loading' and value == 'lazy': return True if name == 'data-bs-toggle' and value == 'tooltip': return True - if name == 'g' and not value: return True + if name in ['g','glow'] and not value: return True if name in ['alt','title']: return True if tag == 'span': diff --git a/files/templates/header.html b/files/templates/header.html index d4549b630..1c4dd4535 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -307,7 +307,7 @@ {% if v and not v.animations -%} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 077c83966..c17a60bab 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 346, + 'css/main.css': 347, 'css/4chan.css': 61, 'css/classic.css': 61,