Commit: 04db57066deb73ef9c960a2c5bebad49195bc1bb Author: Felipe Pena <felipe...@gmail.com> Tue, 25 Jun 2013 21:18:09 -0300 Parents: 40c360194745ad09f066e6a1798d8c18dcdb58f4 Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=04db57066deb73ef9c960a2c5bebad49195bc1bb Log: - Fixed bug #62672 (Error on serialize of ArrayObject) patch by: lior dot k at zend dot com Bugs: https://bugs.php.net/62672 Changed paths: M ext/spl/spl_array.c A ext/spl/tests/bug62672.phpt Diff: diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 2c2c87d..40fbb4c 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -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; diff --git a/ext/spl/tests/bug62672.phpt b/ext/spl/tests/bug62672.phpt new file mode 100644 index 0000000..d0d6a62 --- /dev/null +++ b/ext/spl/tests/bug62672.phpt @@ -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) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php