|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-17 00:04 UTC] gaopeng at eazier dot com
when serialize a array which contains special characters such as "'", """, "\", php4 cannot unserialize it correct, i think the problem is the length of string when do unserialize. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 18:00:01 2025 UTC |
I've run into this problem as well. So far I've had the same problem on 4.3.2, 4.3.4, 4.3.5RC2. The latest snapshot (as of Feb 10) won't compile for me. The problem, like gaopeng said, is with quotes and such. serialize() doesn't store the proper length and it won't unserialize properly. For example: a:1:{i:1;s:7:"Test's";} It says it's 7 bytes long, when it's only 6. If I addslashes() to it, it does this: a:1:{i:1;s:9:"Test\'s";} It's now 7 but it says its 9. Are there any workarounds for this?