ID: 36867 Updated by: [EMAIL PROTECTED] Reported By: mpb dot mail at gmail dot com -Status: Open +Status: Closed Bug Type: SQLite related Operating System: FreeBSD 4.x PHP Version: 4.4.2 New Comment:
Works fine -> closed. Previous Comments: ------------------------------------------------------------------------ [2006-03-27 04:18:48] scottmacvicar at ntlworld dot com This was fixed in the PECL CVS there just happens to have been no release since the bug was fixed. Last release was 18th July 2004, the bug was fixed 27th July 2004. If you compile a CVS copy it will work fine. Perhaps Wez can make another release. ------------------------------------------------------------------------ [2006-03-27 02:30:35] mpb dot mail at gmail dot com Description: ------------ sqlite_escape_string on '' (the empty string) or null returns the wrong value. I would guess that: sqlite_escape_string ('') should return '', and sqlite_escape_string (null) should return null. Additionally, you can see that what sqlite_escape_string actually does return in these cases is a mangled version of the previous non-null input string. This bug appears to have been fixed in PHP5, but not yet in PHP4. http://bugs.php.net/bug.php?id=29339 http://bugs.php.net/bug.php?id=29395 Reproduce code: --------------- <?php print bin2hex (sqlite_escape_string ('xxx')). "\n"; print bin2hex (sqlite_escape_string ('')). "\n"; print bin2hex (sqlite_escape_string (null)). "\n"; print "done\n"; ?> Expected result: ---------------- 787878 done Actual result: -------------- 787878 ac7878 ac7878 done ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36867&edit=1