Req #67453 [Asn->Csd]: Allow to unserialize empty data.
| From: | remi@php.net | Date: | Tue, 17 Jun 2014 07:45:48 +0000 |
| Subject: | Req #67453 [Asn->Csd]: Allow to unserialize empty data. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186221@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
Updated by: remi@php.net
Reported by: remi@php.net
Summary: Allow to unserialize empty data.
-Status: Assigned
+Status: Closed
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 fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
http://git.php.net/?p=php-src.git;a=commitdiff;h=ea466a316ffc39c7d5733c5aa1c37ab604af6e57
Previous Comments:
------------------------------------------------------------------------
[2014-06-16 12:18:40] remi@php.net
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
------------------------------------------------------------------------
[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