diff --git a/alusta.py b/alusta.py index 640a1ec2abbfd8ffd1acda38eefb42de2ab0dcc2..4a97ef4b7c4887ade91d19304a015b6af917864e 100644 --- a/alusta.py +++ b/alusta.py @@ -19,6 +19,9 @@ for paiva in data["MenusForDays"]: if len(ruoka['Components']) != 0: # yhdistetään ruokavaihtoehdon eri komponentit ruokastring = ' '.join(ruoka['Components']) + # EI näin, SQL injection: + #stmt = f"INSERT INTO ateria (paiva, ruoka) VALUES({pvm}, {ruokastring})" + #cur.execute(stmt) cur.execute("INSERT INTO ateria (paiva, ruoka) VALUES(?, ?)", (pvm, ruokastring)) con.commit()