From 60739a75872277b0cde2923678515da24c5936ee Mon Sep 17 00:00:00 2001 From: Arc <33088785+arcbtc@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:34:42 +0000 Subject: [PATCH] For validation --- lnbits/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lnbits/__init__.py b/lnbits/__init__.py index 5c534cba..402b9181 100644 --- a/lnbits/__init__.py +++ b/lnbits/__init__.py @@ -229,7 +229,10 @@ def api_invoices(): return jsonify({"ERROR": "MUST BE JSON"}), 400 postedjson = request.json - + #Form validation + if int(postedjson["value"]) < 0 or not postedjson["memo"].replace(' ','').isalnum(): + return jsonify({"ERROR": "FORM ERROR"}), 401 + if "value" not in postedjson: return jsonify({"ERROR": "NO VALUE"}), 400