From 15f0b963c7c072fa8046e20993894844f2b3efee Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 18 May 2022 20:45:04 +0200 Subject: [PATCH] fc --- files/helpers/const.py | 2 +- files/helpers/sanitize.py | 9 ++++++--- files/templates/authforms.html | 2 +- files/templates/chat.html | 2 +- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- readme.md | 2 +- 14 files changed, 23 insertions(+), 20 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 7d0b2fe9d..6120b62e6 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -670,7 +670,7 @@ if SITE_NAME == 'PCM': AWARDS2 = deepcopy(AWARDS) for k, val in AWARDS.items(): if val['description'] == '???' and not (k == 'ghost' and SITE_NAME == 'PCM'): AWARDS2.pop(k) - if SITE == 'pcmemes.net' and k in ('ban','pizzashill','marsey','bird','grass','chud'): AWARDS2.pop(k) + if SITE == 'pcmemes.net' and k in ('ban','pizzashill','marsey','bird','grass','chud','unblockable'): AWARDS2.pop(k) AWARDS3 = {} diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d45cec26e..5c11581d6 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -40,9 +40,10 @@ def allowed_attributes(tag, name, value): else: return False if name == 'loading' and value == 'lazy': return True - if name == 'referrpolicy' and value == 'no-referrer': return True if name == 'data-bs-toggle' and value == 'tooltip': return True - if name in ['alt','title','g','b']: return True + if name in ['g','b'] and not value: return True + if name in ['alt','title']: return True + if name == 'referrpolicy' and value == 'no-referrer': return True return False if tag == 'lite-youtube': @@ -323,9 +324,11 @@ def sanitize(sanitized, alert=False, comment=False, edit=False): def allowed_attributes_emojis(tag, name, value): if tag == 'img': + if name == 'src' and value.startswith('/'): return True if name == 'loading' and value == 'lazy': return True if name == 'data-bs-toggle' and value == 'tooltip': return True - if name in ['src','alt','title','g']: return True + if name == 'g' and not value: return True + if name in ['alt','title']: return True if tag == 'span': if name == 'data-bs-toggle' and value == 'tooltip': return True diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 79d60118c..eb0b3ea8e 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% if v.css %} diff --git a/files/templates/default.html b/files/templates/default.html index 74f120ee8..49c8ff49a 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -8,7 +8,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index ff2ff79bf..96111d1fc 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/login.html b/files/templates/login.html index 6fb7cd336..9248feb81 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 7311290a4..f47fa523f 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index de414b787..3ad396269 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index a22e43fa6..eb42a6358 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 2e545e8e6..e9a40fb2f 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 94ec7b9a5..83cd4180a 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %} diff --git a/readme.md b/readme.md index cb0e18f53..fd575861d 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ [![Build status](https://img.shields.io/github/workflow/status/TheMotte/rDrama/run_tests.py/frost)](https://github.com/Aevann1/rDrama/actions?query=workflow%3Arun_tests.py+branch%3Afrost) -This code runs https://rdrama.net and https://pcmemes.net +This code runs https://rdrama.net, https://pcmemes.net, https://cringetopia.org, and https://watchpeopledie.co # Installation (Windows/Linux/MacOS)