note 90120 added to function.unserialize
| From: | w dot laurencine at teknoa dot net | Date: | Tue, 07 Apr 2009 12:54:42 +0000 |
| Subject: | note 90120 added to function.unserialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152895@lists.php.net to get a copy of this message | ||
When dealing with a string which contain "\r", it seems that the length is not evaluated
correctly. The following solves the problem for me :
<?php
// remove the \r caracters from the $unserialized string
$unserialized = str_replace("\r","",$unserialized);
// and then unserialize()
unserialize($unserialized);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 68.82.6.9
----
Manual Page -- http://www.php.net/manual/en/function.unserialize.php
Edit -- https://master.php.net/note/edit/90120
Del: integrated -- https://master.php.net/note/delete/90120/integrated
Del: useless -- https://master.php.net/note/delete/90120/useless
Del: bad code -- https://master.php.net/note/delete/90120/bad+code
Del: spam -- https://master.php.net/note/delete/90120/spam
Del: non-english -- https://master.php.net/note/delete/90120/non-english
Del: in docs -- https://master.php.net/note/delete/90120/in+docs
Del: other reasons-- https://master.php.net/note/delete/90120
Reject -- https://master.php.net/note/reject/90120
Search -- https://master.php.net/manage/user-notes.php