fixed sql injektion

This commit is contained in:
2000-Trek 2023-07-05 22:04:12 +02:00
parent ebb942a9a2
commit d015a68c8c

View file

@ -84,7 +84,7 @@ def list():
@app.route("/list/user", methods=['GET'])
def user_info():
id = request.args.get("id")
c.execute(f"SELECT * FROM users WHERE (id) VALUES (?)", [id])
c.execute(f"SELECT * FROM users WHERE id=?", [id])
user_list = c.fetchall()
if user_list != []:
user = user_list[0]
@ -296,7 +296,7 @@ def get_id():
db_log.info(message)
finished = queue_item
conn.commit()
return make_response(json.dumps({"mode":"2","username":username,"message":"1"}))
return make_response(json.dumps({"mode":"message","username":username,"message":"A tag was added"}))
elif state == "remove":
c.execute(f"SELECT * FROM tags WHERE (tagid = {tag_id} AND userid = {user})")
tags = c.fetchall()
@ -306,7 +306,7 @@ def get_id():
db_log.info(message)
finished = queue_item
conn.commit()
return make_response(json.dumps({"mode":"2","username":username,"message":"2"}))
return make_response(json.dumps({"mode":"message","username":username,"message":"A tag was removed"}))
else:
message = "054"
finished = queue_item