|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-30 10:14 UTC] scottmac@php.net
[2008-09-30 10:19 UTC] olafvdspek at gmail dot com
[2011-07-06 07:24 UTC] olafvdspek at gmail dot com
[2011-07-07 03:32 UTC] aharvey@php.net
-Package: Feature/Change Request
+Package: *General Issues
[2011-07-07 03:32 UTC] aharvey@php.net
[2011-07-07 04:31 UTC] olafvdspek at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 02:00:01 2025 UTC |
Description: ------------ The standard mysql_query function is very prone to abuse. Could a function be added that's safer? Like, for example: mysql_query_safe("insert into T (A, B, C) values (?, ?, ?)", $a, $b, $c); The function would be a bit like sprintf, except it would automatically call mysql_real_escape_string on all non-int arguments and enclose them in single quotes. Safe types like int would not receive this treatment. Reproduce code: --------------- mysql_query("insert into T (A, B, C) values (?, ?, ?)", $a, $b, $c); Expected result: ---------------- No SQL injection vulnerability Actual result: -------------- SQL injection vulnerability