note 98321 added to function.unserialize
| From: | thor222 at gmail dot com | Date: | Wed, 09 Jun 2010 09:18:30 +0000 |
| Subject: | note 98321 added to function.unserialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169961@lists.php.net to get a copy of this message | ||
If you serialize date which includes a \n and then try to unserialize it will not work as a class.
Using a modification of the __unserialize fucntion
function __unserialize($sObject) {
$sObject = ereg_replace("\n", " ", $sObject);
return preg_replace('!s:(\d+):"(.*?)";!e',
"'s:'.strlen('$2').':\"$2\";'", $sObject );
}
----
Server IP: 69.147.83.197
Probable Submitter: 81.130.206.16
----
Manual Page -- http://www.php.net/manual/en/function.unserialize.php
Edit -- https://master.php.net/note/edit/98321
Del: integrated -- https://master.php.net/note/delete/98321/integrated
Del: useless -- https://master.php.net/note/delete/98321/useless
Del: bad code -- https://master.php.net/note/delete/98321/bad+code
Del: spam -- https://master.php.net/note/delete/98321/spam
Del: non-english -- https://master.php.net/note/delete/98321/non-english
Del: in docs -- https://master.php.net/note/delete/98321/in+docs
Del: other reasons-- https://master.php.net/note/delete/98321
Reject -- https://master.php.net/note/reject/98321
Search -- https://master.php.net/manage/user-notes.php