fix: [tag export] limit custom tag lenght

This commit is contained in:
Terrtia 2018-11-07 10:17:57 +01:00
parent f91aba5f6f
commit 2c46c7f2ab
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 7 additions and 0 deletions

View file

@ -605,6 +605,10 @@ def disable_hive_auto_alert():
@PasteSubmit.route("/PasteSubmit/add_push_tag")
def add_push_tag():
tag = request.args.get('tag')
#limit tag length
if len(tag) > 49:
tag = tag[0:48]
r_serv_db.sadd('list_export_tags', tag)
to_return = {}

View file

@ -135,6 +135,9 @@ def mixUserName(supplied, extensive=False):
def save_tag_to_auto_push(list_tag):
for tag in set(list_tag):
#limit tag length
if len(tag) > 49:
tag = tag[0:48]
r_serv_db.sadd('list_export_tags', tag)
# ============ ROUTES ============