note 75773 deleted from function.unserialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 01:31:47 +0000 |
| Subject: | note 75773 deleted from function.unserialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191709@lists.php.net to get a copy of this message | ||
Note Submitter: steve at bluearena dot com
----
To getmequick at gmail dot com
Your outstanding preg_replace
<? php
$unserialized = preg_replace('!s:(\d+):"(.*?)";!se',
"'s:'.strlen('$2').':\"$2\";'", $unserialized );
?>
helped me out of a hole after converting a database from latin1 to UTF8 and forgetting about how
strict the strlen of serialized strings needs to be!
I just added the s modifier for it to be able to support whitespace and it fixed everything.
Thanks a million.