pls review
parent
ea7c4f833a
commit
3491c9187d
|
@ -42,8 +42,7 @@ def allowed_attributes(tag, name, value):
|
|||
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','pat']: return True
|
||||
if name == 'class' and value == 'pat-hand': return True
|
||||
if name in ['alt','title','g','b']: return True
|
||||
return False
|
||||
|
||||
if tag == 'lite-youtube':
|
||||
|
@ -71,7 +70,6 @@ def allowed_attributes(tag, name, value):
|
|||
return False
|
||||
|
||||
if tag == 'span':
|
||||
if name == 'class' and value in ['pat-container', 'pat-hand']: return True
|
||||
if name == 'data-bs-toggle' and value == 'tooltip': return True
|
||||
if name == 'title': return True
|
||||
if name == 'alt': return True
|
||||
|
@ -117,12 +115,10 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False):
|
|||
|
||||
if emoji.endswith('pat'):
|
||||
if path.isfile(f"files/assets/images/emojis/{emoji.replace('pat','')}.webp"):
|
||||
attrs += ' pat'
|
||||
emoji_html = f'<span class="pat-container" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:"><img src="/assets/images/hand.webp" class="pat-hand">{emoji_partial_pat.format(old, f"/e/{emoji[:-3]}.webp", attrs)}</span>'
|
||||
emoji_html = f'<span data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:"><img src="/assets/images/hand.webp">{emoji_partial_pat.format(old, f"/e/{emoji[:-3]}.webp", attrs)}</span>'
|
||||
elif emoji.startswith('@'):
|
||||
if u := get_user(emoji[1:-3], graceful=True):
|
||||
attrs += ' pat'
|
||||
emoji_html = f'<span class="pat-container" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:"><img src="/assets/images/hand.webp" class="pat-hand">{emoji_partial_pat.format(old, f"/pp/{u.id}", attrs)}</span>'
|
||||
emoji_html = f'<span data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:"><img src="/assets/images/hand.webp">{emoji_partial_pat.format(old, f"/pp/{u.id}", attrs)}</span>'
|
||||
elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
|
||||
emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs)
|
||||
|
||||
|
@ -320,6 +316,12 @@ def allowed_attributes_emojis(tag, name, value):
|
|||
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 tag == 'span':
|
||||
if name == 'data-bs-toggle' and value == 'tooltip': return True
|
||||
if name == 'title': return True
|
||||
if name == 'alt': return True
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
|
@ -334,7 +336,7 @@ def filter_emojis_only(title, edit=False, graceful=False):
|
|||
|
||||
title = strikethrough_regex.sub(r'<del>\1</del>', title)
|
||||
|
||||
title = bleach.clean(title, tags=['img','del'], attributes=allowed_attributes_emojis, protocols=['http','https'])
|
||||
title = bleach.clean(title, tags=['img','del','span'], attributes=allowed_attributes_emojis, protocols=['http','https'])
|
||||
|
||||
signal.alarm(0)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -40,7 +40,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>Chat</title>
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.css %}
|
||||
<link rel="stylesheet" href="/@{{v.username}}/css">
|
||||
|
|
|
@ -845,7 +845,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if v %}
|
||||
<script src="/assets/js/marked.js?v=252"></script>
|
||||
<script src="/assets/js/marked.js?v=253"></script>
|
||||
<script src="/assets/js/comments_v.js?v=266"></script>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script src="/assets/js/bootstrap.js?v=245"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -32,7 +32,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -104,12 +104,12 @@ Text 2
|
|||
<tr>
|
||||
<td>Pat Emojis</td>
|
||||
<td>:marseylovepat:</td>
|
||||
<td><span alt=":marseylovepat:" class="pat-container" data-bs-toggle="tooltip" title=":marseylovepat:"><img class="pat-hand" src="/assets/images/hand.webp"><img alt=":marseylovepat:" b="" loading="lazy" pat="" src="/e/marseylove.webp"></span></td>
|
||||
<td><span alt=":marseylovepat:" data-bs-toggle="tooltip" title=":marseylovepat:"><img src="/assets/images/hand.webp"><img alt=":marseylovepat:" b="" loading="lazy" pat="" src="/e/marseylove.webp"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pat User</td>
|
||||
<td>:@snappypat:</td>
|
||||
<td><span alt=":@snappypat:" class="pat-container" data-bs-toggle="tooltip" title="" data-bs-original-title=":@snappypat:" aria-label=":@snappypat:"><img class="pat-hand" src="/assets/images/hand.webp"><img alt=":@snappypat:" b="" loading="lazy" pat="" src="/pp/3"></span></td>
|
||||
<td><span alt=":@snappypat:" data-bs-toggle="tooltip" title="" data-bs-original-title=":@snappypat:" aria-label=":@snappypat:"><img src="/assets/images/hand.webp"><img alt=":@snappypat:" b="" loading="lazy" pat="" src="/pp/3"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Random Marsey</td>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -31,7 +31,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -51,7 +51,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=265">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=266">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=49">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -224,7 +224,7 @@
|
|||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script src="/assets/js/marked.js?v=252"></script>
|
||||
<script src="/assets/js/marked.js?v=253"></script>
|
||||
<script src="/assets/js/formatting.js?v=240"></script>
|
||||
<script src="/assets/js/submit.js?v=255"></script>
|
||||
{% include "emoji_modal.html" %}
|
||||
|
|
|
@ -769,7 +769,7 @@
|
|||
</nav>
|
||||
{% endif %}
|
||||
|
||||
<script src="/assets/js/marked.js?v=252"></script>
|
||||
<script src="/assets/js/marked.js?v=253"></script>
|
||||
|
||||
|
||||
{% if v and v.id != u.id and '/comments' not in request.path %}
|
||||
|
|
Loading…
Reference in New Issue