mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: - Fixed bug #62672 (Error on serialize of ArrayObject) patch by: lior dot k at zend dot com - BFN
This commit is contained in:
commit
f5bf90ef34
2 changed files with 32 additions and 1 deletions
|
@ -1766,7 +1766,7 @@ SPL_METHOD(Array, unserialize)
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
if (*p!='m') {
|
if (*p!='m') {
|
||||||
if (*p!='a' && *p!='O' && *p!='C') {
|
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||||
goto outexcept;
|
goto outexcept;
|
||||||
}
|
}
|
||||||
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
||||||
|
|
31
ext/spl/tests/bug62672.phpt
Normal file
31
ext/spl/tests/bug62672.phpt
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #62672 (Error on serialize of ArrayObject)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class ObjA
|
||||||
|
{
|
||||||
|
private $_varA;
|
||||||
|
|
||||||
|
public function __construct(Iterator $source)
|
||||||
|
{
|
||||||
|
$this->_varA = $source;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ObjB extends ObjA
|
||||||
|
{
|
||||||
|
private $_varB;
|
||||||
|
|
||||||
|
public function __construct(ArrayObject $keys)
|
||||||
|
{
|
||||||
|
$this->_varB = $keys;
|
||||||
|
parent::__construct($keys->getIterator());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$obj = new ObjB(new ArrayObject());
|
||||||
|
|
||||||
|
var_dump($obj == unserialize(serialize($obj)));
|
||||||
|
--EXPECTF--
|
||||||
|
bool(true)
|
Loading…
Add table
Add a link
Reference in a new issue