master
Aevann1 2021-08-05 16:58:25 +02:00
parent 28389b0d3f
commit 111630dc0b
3 changed files with 4 additions and 5 deletions

View File

@ -178,7 +178,7 @@ def sanitize(text, linkgen=False, flair=False):
start = '<s>'
end = '</s>'
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
if flair: emojisize = 20
else: emojisize = 30

View File

@ -11,11 +11,10 @@ def api_flag_post(pid, v):
post = get_post(pid)
if v:
existing = g.db.query(Flag).filter_by(
user_id=v.id, post_id=post.id).first()
existing = g.db.query(Flag).filter_by(user_id=v.id, post_id=post.id).first()
if existing: return "", 409
reason = sanitize(request.form.get("reason", "")[:100].strip(), flair=True)
reason = sanitize(request.form.get("reason", "").strip()[:100], flair=True)
flag = Flag(post_id=post.id,
user_id=v.id,

View File

@ -79,7 +79,7 @@
<div><img src="{{v.profile_url}}" class="profile-pic-35"></div>
<div class="text-left pl-2">
<div style="color: #{{v.namecolor}}" class="text-small font-weight-bold {% if v.animatedname %}{% if v.patron %}patron{% else %}leaderboard{% endif %}{% endif %}">{{v.username}}</div>
<div class="text-small-extra text-purple"><i class="fad fa-diamond mr-1"></i>{{v.coins}} {{"SITE_NAME" | app_config}}coins</div>
<div class="text-small-extra text-purple"><i class="fad fa-coins mr-1"></i>{{v.coins}} {{"SITE_NAME" | app_config}}coins</div>
</div>
</div>
</a>