#32204 [Opn->Bgs]: sqlite_udf_encode_binary fails to escape some chunks
| From: | sniper@php.net | Date: | Sun, 06 Mar 2005 15:13:38 +0000 |
| Subject: | #32204 [Opn->Bgs]: sqlite_udf_encode_binary fails to escape some chunks | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74896@lists.php.net to get a copy of this message | ||
ID: 32204
Updated by: sniper@php.net
Reported By: php at lachoseinteractive dot net
-Status: Open
+Status: Bogus
Bug Type: SQLite related
Operating System: Mac OS X 10.3
PHP Version: 5.0.3
New Comment:
Forgot.
Previous Comments:
------------------------------------------------------------------------
[2005-03-06 13:31:52] php at lachoseinteractive dot net
Forget about it. sqlite_udf_encode_binary is not
supposed to escape quotes :-/
------------------------------------------------------------------------
[2005-03-06 12:21:02] php at lachoseinteractive dot net
Description:
------------
While I've used successfully sqlite_udf_encode_binary to
save hundreds of Mo of images in sqlite databases, I've
had a weird error on a .bmp file.
It looks like a quote character is not escaped.
I've reduced the chunk to its minimum and converted it
to base64.
The code is also available here :
http://ns3314.ovh.net/~dom/
sqlite_udf_encode_binary_bug.php.txt
Reproduce code:
---------------
<?
$db = new SQLiteDatabase("/db/bug.db");
$db->queryExec("BEGIN;");
$db->queryExec("CREATE TABLE files_chunks (data blob NOT NULL
DEFAULT '', id INTEGER);");
$chunk_b64 =
"////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////!
/////////////////////////////////////////////////////////////!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////1fz/stzYRENRREJLPURNP0BNQUFGOzxJOzM5OzQ6OztDO0FGNzpPPEBFODZEPDlEPDM6ODQ8ODU4OC03PDNAO0JMO0FJOz9NOzpIOzlMOkBMOzpKO0BGOkI+QTM6NzlIODM9ODlIPDREOzhHO0BJO0BMNjpMOzpHNzZENkFJPD9MOj5PNjhENzhFPC45OCUjOCY3NygvPDIwNzEnPCclNycyODMvMScwPDAxNzAvPDY1NzAuOTcuODA0PSU0ODI0MjE0OjA1MjEuODAuOTEuNzUuODk0MTQ6Ny4zOztBNzM5Nzg+OS9BQjFAU1xocniQhpypkqa2o7nMpbvLpr";
$daFile = base64_decode($chunk_b64);
$db->queryExec("INSERT INTO files_chunks (id, data) VALUES (1,
'".sqlite_udf_encode_binary($daFile)."');") or die("failed");
$db->queryExec("ROLLBACK;");
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32204&edit=1