From: Xinchen Hui Date: Tue, 12 Jul 2016 04:14:45 +0000 (+0800) Subject: backport to 5.6 (we should not unset the default value) X-Git-Tag: php-7.1.0beta1~101^2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7903276f4c18fcfda06c02785f0b4201421f9c7c;p=php backport to 5.6 (we should not unset the default value) --- diff --git a/NEWS b/NEWS index 2b21a03c0e..5da0c578eb 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2016, PHP 5.6.25 - Core: + . Fixed bug #72581 (previous property undefined in Exception after + deserialization). (Laruence) . Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net) - Curl: diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 66476a1517..fda4d21e03 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -230,7 +230,7 @@ ZEND_METHOD(exception, __construct) Exception unserialize checks */ #define CHECK_EXC_TYPE(name, type) \ value = zend_read_property(default_exception_ce, object, name, sizeof(name)-1, 0 TSRMLS_CC); \ - if(value && Z_TYPE_P(value) != type) { \ + if (value && Z_TYPE_P(value) != IS_NULL && Z_TYPE_P(value) != type) { \ zval *tmp; \ MAKE_STD_ZVAL(tmp); \ ZVAL_STRINGL(tmp, name, sizeof(name)-1, 1); \ diff --git a/ext/standard/tests/serialize/bug69152.phpt b/ext/standard/tests/serialize/bug69152.phpt index bc2b302ddb..4e741685cc 100644 --- a/ext/standard/tests/serialize/bug69152.phpt +++ b/ext/standard/tests/serialize/bug69152.phpt @@ -9,7 +9,6 @@ $x->test(); ?> --EXPECTF-- -Notice: Undefined property: Exception::$previous in %s on line %d exception 'Exception' in %s:%d Stack trace: #0 {main} diff --git a/ext/standard/tests/serialize/bug69793.phpt b/ext/standard/tests/serialize/bug69793.phpt index 624f1ac740..b5784b89eb 100644 --- a/ext/standard/tests/serialize/bug69793.phpt +++ b/ext/standard/tests/serialize/bug69793.phpt @@ -7,8 +7,6 @@ $e = unserialize('O:9:"Exception":7:{s:17:"'."\0".'Exception'."\0".'string";s:1: var_dump($e.""); ?> --EXPECTF-- -Notice: Undefined property: Exception::$message in %s%ebug69793.php on line %d - Notice: Undefined property: Exception::$file in %s%ebug69793.php on line %d Notice: Undefined property: Exception::$previous in %s%ebug69793.php on line %d