Req #67453 [PATCH]: Allow to unserialize empty data.
| From: | remi@php.net | Date: | Mon, 16 Jun 2014 12:18:40 +0000 |
| Subject: | Req #67453 [PATCH]: Allow to unserialize empty data. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186210@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67453&edit=1
ID: 67453
Patch added by: remi@php.net
Reported by: remi@php.net
Summary: Allow to unserialize empty data.
Status: Assigned
Type: Feature/Change Request
Package: SPL related
Operating System: irrevelant
PHP Version: 5.6.0beta4
Assigned To: remi
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: php-unserialize.patch
Revision: 1402921120
URL: https://bugs.php.net/patch-display.php?bug=67453&patch=php-unserialize.patch&revision=1402921120
Previous Comments:
------------------------------------------------------------------------
[2014-06-16 12:17:47] remi@php.net
Description:
------------
SplDoublyLinkedList, SplObjectStorage and ArrayObject have empty constructor (no arg), so it make
sense to allow to unserialize empty data.
This also the hack (used in various place, including PHPUnit) to instanciate class without call to
constructor to work.
Test script:
---------------
$a = new ArrayObject(array());
$a->unserialize("");
Expected result:
----------------
No error
Actual result:
--------------
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty
serialized string cannot be empty' in ...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67453&edit=1