note 89474 deleted from function.serialize by jani
| From: | jani@php.net | Date: | Wed, 06 May 2009 18:44:28 +0000 |
| Subject: | note 89474 deleted from function.serialize by jani | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154287@lists.php.net to get a copy of this message | ||
Note Submitter: bmauser at gmail
----
Sometimes there can be null characters (\0) in return from serialize() function!
see: http://bugs.php.net/bug.php?id=44433
I tried to store serialized object in the database using PDO_PGSQL driver and values in queries were
truncated to first null character.
You can use base64_encode and decode to workaround or something like:
<?php
$serialized_data = str_replace("\x00", ' ', serialize($object));
?>