From 111c9ab2085b74dd9b488b0467d7fe384ec69300 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 2 Nov 2022 05:22:16 +0200 Subject: [PATCH] fix this https://rdrama.life/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/3007141?context=8#context --- files/routes/admin.py | 1 + files/routes/awards.py | 5 +++-- files/routes/settings.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 0ea30e237..fb0fe0942 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -929,6 +929,7 @@ def admin_title_change(user_id, v): user.customtitleplain=new_name new_name = filter_emojis_only(new_name) + new_name = censor_slurs(new_name, None) user=get_account(user.id) user.customtitle=new_name diff --git a/files/routes/awards.py b/files/routes/awards.py index b6afb2e39..ebc9baf34 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -263,9 +263,10 @@ def award_thing(v, thing_type, id): author.flairchanged += 86400 else: author.customtitleplain = new_name + new_name = filter_emojis_only(new_name) new_name = censor_slurs(new_name, None) - author.customtitle = filter_emojis_only(new_name) - if len(author.customtitle) > 1000: abort(403) + if len(new_name) > 1000: abort(403) + author.customtitle = new_name author.flairchanged = int(time.time()) + 86400 badge_grant(user=author, badge_id=96) elif kind == "pause": diff --git a/files/routes/settings.py b/files/routes/settings.py index d0ba13464..ee02204b6 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -843,7 +843,9 @@ def settings_title_change(v): if customtitleplain == v.customtitleplain: return render_template("settings_profile.html", v=v, error="You didn't change anything") - customtitle = filter_emojis_only(censor_slurs(customtitleplain, None)) + customtitle = filter_emojis_only(customtitleplain) + + customtitle = censor_slurs(customtitle, None) if len(customtitle) > 1000: return render_template("settings_profile.html", v=v, error="Flair too long!")