Aevann1 2022-11-02 05:22:16 +02:00
parent 28318ae080
commit 111c9ab208
3 changed files with 7 additions and 3 deletions

View File

@ -929,6 +929,7 @@ def admin_title_change(user_id, v):
user.customtitleplain=new_name user.customtitleplain=new_name
new_name = filter_emojis_only(new_name) new_name = filter_emojis_only(new_name)
new_name = censor_slurs(new_name, None)
user=get_account(user.id) user=get_account(user.id)
user.customtitle=new_name user.customtitle=new_name

View File

@ -263,9 +263,10 @@ def award_thing(v, thing_type, id):
author.flairchanged += 86400 author.flairchanged += 86400
else: else:
author.customtitleplain = new_name author.customtitleplain = new_name
new_name = filter_emojis_only(new_name)
new_name = censor_slurs(new_name, None) new_name = censor_slurs(new_name, None)
author.customtitle = filter_emojis_only(new_name) if len(new_name) > 1000: abort(403)
if len(author.customtitle) > 1000: abort(403) author.customtitle = new_name
author.flairchanged = int(time.time()) + 86400 author.flairchanged = int(time.time()) + 86400
badge_grant(user=author, badge_id=96) badge_grant(user=author, badge_id=96)
elif kind == "pause": elif kind == "pause":

View File

@ -843,7 +843,9 @@ def settings_title_change(v):
if customtitleplain == v.customtitleplain: if customtitleplain == v.customtitleplain:
return render_template("settings_profile.html", v=v, error="You didn't change anything") 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: if len(customtitle) > 1000:
return render_template("settings_profile.html", v=v, error="Flair too long!") return render_template("settings_profile.html", v=v, error="Flair too long!")