remove graceful=True from filter_emojis_only cuz its not useful at all

pull/200/head
Aevann 2023-09-06 21:14:07 +03:00
parent 7cd1fbd08f
commit 50439f988f
2 changed files with 4 additions and 6 deletions

View File

@ -699,7 +699,7 @@ def allowed_attributes_emojis(tag, name, value):
@with_sigalrm_timeout(2)
def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False):
def filter_emojis_only(title, golden=True, count_emojis=False):
title = title.replace("\n", "").replace("\r", "").replace("\t", "").replace('<','&lt;').replace('>','&gt;')
@ -718,8 +718,8 @@ def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False):
title = bleach.clean(title, tags=['img','del','span'], attributes=allowed_attributes_emojis, protocols=['http','https']).replace('\n','')
if len(title) > POST_TITLE_HTML_LENGTH_LIMIT and not graceful:
abort(400)
if len(title) > POST_TITLE_HTML_LENGTH_LIMIT:
abort(400, "Rendered title is too big!")
title = title.strip()

View File

@ -432,12 +432,10 @@ def submit_post(v, sub=None):
if SITE == 'rdrama.net' and v.id == 10947:
sub = 'mnn'
title_html = filter_emojis_only(title, graceful=True, count_emojis=True)
title_html = filter_emojis_only(title, count_emojis=True)
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:
abort(400, "Rendered title is too big!")
if sub == 'changelog':
abort(400, "/h/changelog is archived")