From 886ea67539564b1190566ec676a475588f86a443 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 30 Jun 2019 05:55:21 -0500 Subject: [PATCH] final cursed ubuntu fix v5 --- app/routes.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/routes.py b/app/routes.py index 26985cd..fa77117 100644 --- a/app/routes.py +++ b/app/routes.py @@ -88,24 +88,26 @@ def boolparse(string, default=False): # return False else: return False - + +# The only implementation I could get to work +def validate_id(id): + id = str(id).strip() + val = str(app.config['HIDDEN_URL']).strip() + return id == val + @app.route('/hidden/help') @login_required def hidden_help(id): - id = str(id).strip() - val = str(app.config['HIDDEN_URL']).strip() - if id != val: - return '{} != {}'.format(id, val) - else: + if validate_id(id): return render_template('hidden_help.html') + else: + return 'error: bad id' @app.route('/hidden') @login_required def hidden(id): - id = str(id).strip() - val = str(app.config['HIDDEN_URL']).strip() - if id != val: - return '{} != {}'.format(id, val) + if not validate_id(id): + return 'bad id' # Handled within request tags = request.args.get('tags') or 'trap' try: