note 98625 deleted from function.unserialize by danbrown
| From: | danbrown@php.net | Date: | Thu, 09 Sep 2010 14:18:55 +0000 |
| Subject: | note 98625 deleted from function.unserialize by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172414@lists.php.net to get a copy of this message | ||
Note Submitter: stepanic dot matija at gmail dot com
----
I have solved problem
Notice: unserialize() [function.unserialize]: Error at offset 139 of 151 bytes in...
with this code
<?php
function __unserialize($sObject) {
$sObject = ereg_replace("\n", " ", $sObject);
$sObject=htmlspecialchars_decode($sObject); //THIS FIXED
return preg_replace('!s:(\d+):"(.*?)";!e',
"'s:'.strlen('$2').':\"$2\";'", $sObject );
}
?>