note 89474 added to function.serialize

From: Date: Mon, 09 Mar 2009 23:42:23 +0000
Subject: note 89474 added to function.serialize
Groups: php.notes 
Request: Send a blank email to php-notes+get-151672@lists.php.net to get a copy of this message
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)); ?> ---- Server IP: 193.198.184.18 Probable Submitter: 82.193.211.81 ---- Manual Page -- http://www.php.net/manual/en/function.serialize.php Edit -- https://master.php.net/note/edit/89474 Del: integrated -- https://master.php.net/note/delete/89474/integrated Del: useless -- https://master.php.net/note/delete/89474/useless Del: bad code -- https://master.php.net/note/delete/89474/bad+code Del: spam -- https://master.php.net/note/delete/89474/spam Del: non-english -- https://master.php.net/note/delete/89474/non-english Del: in docs -- https://master.php.net/note/delete/89474/in+docs Del: other reasons-- https://master.php.net/note/delete/89474 Reject -- https://master.php.net/note/reject/89474 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151672) next »