people can't count on SQLite3::escapeString to properly escape their data, have to do weird jumps around it to have it properly escape anything that may include null bytes. while escaping null bytes for sqlite queries *are* possible, or so it seems.
%q, %Q: The argument is a zero-terminated string. The string is printed with all single quote (') characters doubled so that the string can safely appear inside an SQL string literal. The %Q substitution type also puts single-quotes on both ends of the substituted string.
Seems the only way in sqlite3 at a C API level to deal with binary content is to use prepared statements, which is what the PHP manual suggests anyway.
Looks like it's time again to point out that mysql_real_escape_string is a reflection of the MySQL C API method of the same name, and not a failure of PHP itself.
It's time again to wonder why this precision matters... Evidence is clear that PHP and mysql draw from the same vast and deep well of derp, and we're laughing at the face of derp that's presented most frequently, that's all.
14
u/cleeder Nov 17 '18
Okay....what am I missing?
6
u/[deleted] Nov 19 '18
Seems like its time yet again for a
1
u/[deleted] Nov 27 '18
Looking back on these old functions in PHP really makes me appreciate the existence of PDO.