Skip to content

Commit 20f3cf7

Browse files
author
patched.codes[bot]
committed
Patched /tmp/tmpag5ifxhr/index.py
1 parent 5e38558 commit 20f3cf7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

index.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
}
88

99
def get_data_by_config_value(value):
10-
# This might look suspicious due to string concatenation with values from CONFIG.
11-
query = "SELECT * FROM " + CONFIG["default_table"] + " WHERE " + CONFIG["default_column"] + " = '" + value + "'"
12-
1310
connection = sqlite3.connect("database.db")
1411
cursor = connection.cursor()
15-
cursor.execute(query)
12+
cursor.execute("SELECT * FROM {} WHERE {} = ?".format(CONFIG["default_table"], CONFIG["default_column"]), (value,))
1613
result = cursor.fetchall()
1714
connection.close()
1815

0 commit comments

Comments
 (0)