Skip to content

Commit 42b0b4c

Browse files
author
patched.codes[bot]
committed
Patched /tmp/tmpksa429lb/index.py
1 parent 5e38558 commit 42b0b4c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
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+
query = "SELECT * FROM {} WHERE {} = ?".format(CONFIG["default_table"], CONFIG["default_column"])
13+
cursor.execute(query, (value,))
1614
result = cursor.fetchall()
1715
connection.close()
1816

0 commit comments

Comments
 (0)