note 99802 added to function.unserialize
| From: | trepanovitch at gmail dot com | Date: | Wed, 08 Sep 2010 08:55:08 +0000 |
| Subject: | note 99802 added to function.unserialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172370@lists.php.net to get a copy of this message | ||
There is a problem with the function provided first by Thor222 and then stepanic if the
__unserialize meets the following string \"; the regex will stop at the offset of this
character, here is my fix to this problem :
return preg_replace('/s:(\d+):"((.*?)(?<!\\\\))";/sie',
"'s:'.strlen('$2').':\"$2\";'", $serial_str );
Best regards
----
Server IP: 69.147.83.197
Probable Submitter: 77.195.243.93
----
Manual Page -- http://www.php.net/manual/en/function.unserialize.php
Edit -- https://master.php.net/note/edit/99802
Del: integrated -- https://master.php.net/note/delete/99802/integrated
Del: useless -- https://master.php.net/note/delete/99802/useless
Del: bad code -- https://master.php.net/note/delete/99802/bad+code
Del: spam -- https://master.php.net/note/delete/99802/spam
Del: non-english -- https://master.php.net/note/delete/99802/non-english
Del: in docs -- https://master.php.net/note/delete/99802/in+docs
Del: other reasons-- https://master.php.net/note/delete/99802
Reject -- https://master.php.net/note/reject/99802
Search -- https://master.php.net/manage/user-notes.php