From d7d8a57e0fad0f2d0af3cf15d44235801a8e4d4c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 9 Nov 2023 12:17:55 +1100 Subject: [PATCH] fix: Verify data before parsing --- main.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 277a4b5..9d9ee5c 100644 --- a/main.py +++ b/main.py @@ -89,9 +89,21 @@ def edit(): return resp data = db.get_website_data_raw(user['domain']) + html = "" + hns = "" + btc = "" + eth = "" + if 'data' in data: + html = data['data'].encode('utf-8').decode('unicode-escape') + if 'HNS' in data: + hns = data['HNS'] + if 'BTC' in data: + btc = data['BTC'] + if 'ETH' in data: + eth = data['ETH'] - return render_template('edit.html',account=user['email'],account_link="account",data=data['data'],hns=data['HNS'],btc=data['BTC'],eth=data['ETH']) + return render_template('edit.html',account=user['email'],account_link="account",data=html,hns=hns,btc=btc,eth=eth) @app.route('/edit', methods=['POST'])