serialzed array crash
Issue #58
invalid
Originally reported on Google Code with ID 58
My application store some serialized array in TEXT field of SQLite.
When this array is storing (always with sqlite_escape_string), getting and modifying
by application everything is fine, but when I made some changes in database using phpLiteAdmin
1.8.7 the serialized data being corrupted and after that unserialize function return
false and notice: Error at offset. Maybe someone could fix it :)
Example:
CREATE TABLE user( id INTEGER PRIMARY KEY, email TEXT, hash TEXT, stamp INTEGER, arr
TEXT) some data in it
$arr['UB'] = array(1, 433, 7472, 74);
$arr[] = array();
UPDATE user SET arr = 'sqlite_escape_string(serialize($arr))' WHERE id = 9
If I try modify, with phpLiteAdmin, some one of field email, hash or stamp (but not
arr) data in arr field are crashed and could not be unserialzed later. Sorry for my
English.
Reported by kudawa666@wp.pl
on 2011-08-31 19:30:39
Comments (4)
-
Account Deleted -
Account Deleted ``` The problem is in adding slashes and newline to string when some row is updating. ```
Reported by `kudawa666@wp.pl` on 2011-09-01 09:29:09
-
Thanks for your bug report and sorry for the late response. Does this issue still occur in phpLiteAdmin 1.9.3 ? I just tried to reproduce it and was not able to. If you say slashes are added, you might have a problem with magic quotes. See the following site on how to disable it: http://www.php.net/manual/en/security.magicquotes.disabling.php Magic Quotes is deprecated as of 5.3.0 and will be removed in 5.4.0, so it's not a good idea to keep using it anyway.
Reported by
crazy4chrissi
on 2012-11-07 11:20:44 -
I mark this as invalid because we did not get any response for quite a lot of time and it is not reproducible (any more). Moreover, phpLiteAdmin 1.9.4 comes with a workaround for servers with magic quotes enabled that should fix any issues related to magic quotes. If you or somebody else still has this problem, please post here and I will reopen the issue.
Reported by
crazy4chrissi
on 2013-03-20 16:31:39 - Status changed:Invalid
- Log in to comment
``` On Windows 7 64bit and XP 32bit ApacheFriends XAMPP (Basispaket) version 1.7.4 + Apache 2.2.17 + PHP 5.3.5 (VC6 X86 32bit) + PEAR + SQLite 2.8.15 + Zend Optimizer 3.3.0
And on Gentoo OVH RLS2 (2.6.32.2-xxxx-grs-ipv4-64
#4SMP Sat Sep 18 12:06:23 UTC 2010 x86_64) PHP Version: 5.2.13-pl0-gentoo PECL Module version: 2.0-dev $Id: sqlite.c 293036 2010-01-03 09:23:27Z sebastian $ SQLite Library: 2.8.17 SQLite Encoding: iso8859 ```Reported by `kudawa666@wp.pl` on 2011-08-31 20:01:52