klog icon indicating copy to clipboard operation
klog copied to clipboard

SQL break on "

Open ea4k opened this issue 3 years ago • 2 comments

It is needed to clean the data to prevent SQLi IMG_20220511_182317_128.jpg

ea4k avatar May 11 '22 16:05 ea4k

FYI this is the way queries should be build

QSqlQuery query;
query.prepare("INSERT INTO employee (id, name, salary) "
              "VALUES (:id, :name, :salary)");
query.bindValue(":id", 1001);
query.bindValue(":name", "Thad Beaumont");
query.bindValue(":salary", 65000);
query.exec();

majkrzak avatar May 30 '22 14:05 majkrzak

Absolutely right. I will start rewriting queries that way. Thanks

ea4k avatar Jun 26 '23 13:06 ea4k