From 1929b2c6a797944cf3f94914b80dc675624aa016 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 5 Jun 2019 16:18:30 +0200 Subject: [PATCH] fix: [paste_submit UI] filter empty file field --- var/www/modules/PasteSubmit/Flask_PasteSubmit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py index cc38de77..68cd75ae 100644 --- a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py +++ b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py @@ -294,6 +294,12 @@ def submit(): ltagsgalaxies = request.form['tags_galaxies'] paste_content = request.form['paste_content'] + is_file = False + file = request.files['file'] + if file: + if file.filename: + is_file = True + submitted_tag = 'infoleak:submission="manual"' #active taxonomies @@ -312,9 +318,7 @@ def submit(): else: ltags = submitted_tag - if 'file' in request.files: - - file = request.files['file'] + if is_file: if file: if file and allowed_file(file.filename):