From 0bc3f542098b63392fbc8e05e87c6a8c65cc1e24 Mon Sep 17 00:00:00 2001
From: 2000-Trek
Date: Fri, 23 Jun 2023 21:22:10 +0200
Subject: [PATCH] url quote
---
main.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/main.py b/main.py
index 0761e5d..ab02517 100644
--- a/main.py
+++ b/main.py
@@ -51,8 +51,7 @@ def list():
users = c.fetchall()
text = ""
for i in users:
- username = urllib.parse.quote_plus(i[1], safe='_.-~')
- text = text + f'{escape(i[1])}: {i[2]}
'
+ text = text + f'{escape(i[1])}: {i[2]}
'
return '''
@@ -69,9 +68,8 @@ def list():
@app.route("/list/user", methods=['GET'])
def user_info():
- username = urllib.parse.unquote_plus(request.args.get("user"))
- db_log.info(str(username))
- c.execute("SELECT * FROM users WHERE username = ?", [username])
+ id = urllib.parse.unquote_plus(request.args.get("id"))
+ c.execute(f"SELECT * FROM users WHERE id = {id}")
user_list = c.fetchall()
if user_list != []:
user = user_list[0]
@@ -85,7 +83,7 @@ def user_info():
{escape(user[1])} : {user[2]}