php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70730 Incorrect ArrayObject serialization if unset is called in serialize()
Submitted: 2015-10-16 21:47 UTC Modified: -
From: eddielau224 at gmail dot com Assigned:
Status: Closed Package: SPL related
PHP Version: 7.0.0RC5 OS: Mac OS X Yosemite
Private report: No CVE-ID: None
 [2015-10-16 21:47 UTC] eddielau224 at gmail dot com
Description:
------------
If a class extending ArrayObject overrides serialize() and calls unset() on it's member variable. It's serialized string will be incorrect. In the test script, the serialized string will contain 'm:a:1:{}', causing 'Unexpected end of serialized data'.
The test script is working in PHP 5.6

Test script:
---------------
https://3v4l.org/v353G

Expected result:
----------------
Unserialization performed without errors.

Actual result:
--------------
'Unexpected end of serialized data' notice

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-17 13:07 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e2d6090043aed271d18a4d157cbb64138481c9ed
Log: Fixed bug #70730 (Incorrect ArrayObject serialization if unset is called in serialize())
 [2015-10-17 13:07 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-10-25 12:42 UTC] ab@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8836fdd4ed402c70e55b4646c605e6da4dc3b344
Log: Fixed bug #70730 (Incorrect ArrayObject serialization if unset is called in serialize())
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e2d6090043aed271d18a4d157cbb64138481c9ed
Log: Fixed bug #70730 (Incorrect ArrayObject serialization if unset is called in serialize())
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC