forked from rDrama/rDrama
remove graceful=True from filter_emojis_only cuz its not useful at all
parent
7cd1fbd08f
commit
50439f988f
|
@ -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('<','<').replace('>','>')
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue