From 2c46c7f2abbc496a921694f87f309ec5dfc4c09c Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 7 Nov 2018 10:17:57 +0100 Subject: [PATCH] fix: [tag export] limit custom tag lenght --- var/www/modules/PasteSubmit/Flask_PasteSubmit.py | 4 ++++ var/www/modules/terms/Flask_terms.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py index 47f6286b..79aea450 100644 --- a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py +++ b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py @@ -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 = {} diff --git a/var/www/modules/terms/Flask_terms.py b/var/www/modules/terms/Flask_terms.py index c4aebc08..1f0bbfb3 100644 --- a/var/www/modules/terms/Flask_terms.py +++ b/var/www/modules/terms/Flask_terms.py @@ -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 ============