fix 500 errors

pull/142/head
Aevann 2023-03-19 14:01:54 +02:00
parent cbef608cb2
commit f5a68a7e79
3 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ def speak(data, v):
if image: text += f'\n\n{image}'
if not text: return '', 400
text_html = sanitize(text, count_marseys=True, chat=True)
text_html = sanitize(text, count_emojis=True, chat=True)
if isinstance(text_html , tuple):
return text_html

View File

@ -230,7 +230,7 @@ def comment(v:User):
if v.marsify: body_for_sanitize = marsify(body_for_sanitize)
torture = (v.agendaposter and not v.marseyawarded and not (posting_to_submission and post_target.sub == 'chudrama') and post_target.id not in ADMIGGER_THREADS)
body_html = sanitize(body_for_sanitize, limit_pings=5, count_marseys=not v.marsify, torture=torture)
body_html = sanitize(body_for_sanitize, limit_pings=5, count_emojis=not v.marsify, torture=torture)
if post_target.id not in ADMIGGER_THREADS and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower():
existing = g.db.query(Comment.id).filter(

View File

@ -446,7 +446,7 @@ def submit_post(v:User, sub=None):
sub = request.values.get("sub", "").lower().replace('/h/','').strip()
torture = (v.agendaposter and not v.marseyawarded and sub != 'chudrama')
title_html = filter_emojis_only(title, graceful=True, count_marseys=True, torture=torture)
title_html = filter_emojis_only(title, graceful=True, count_emojis=True, torture=torture)
if v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html):
abort(400, "You can only type marseys!")
if len(title_html) > POST_TITLE_HTML_LENGTH_LIMIT:
@ -560,7 +560,7 @@ def submit_post(v:User, sub=None):
torture = (v.agendaposter and not v.marseyawarded and sub != 'chudrama')
body_html = sanitize(body, count_marseys=True, limit_pings=100, showmore=False, torture=torture)
body_html = sanitize(body, count_emojis=True, limit_pings=100, showmore=False, torture=torture)
if v.marseyawarded and marseyaward_body_regex.search(body_html):
abort(400, "You can only type marseys!")