mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- Fixed bug #62672 (Error on serialize of ArrayObject) patch by: lior dot k at zend dot com
This commit is contained in:
parent
40c3601947
commit
04db57066d
2 changed files with 32 additions and 1 deletions
|
@ -1778,7 +1778,7 @@ SPL_METHOD(Array, unserialize)
|
|||
++p;
|
||||
|
||||
if (*p!='m') {
|
||||
if (*p!='a' && *p!='O' && *p!='C') {
|
||||
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||
goto outexcept;
|
||||
}
|
||||
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