]> granicus.if.org Git - php/commitdiff
backport to 5.6 (we should not unset the default value)
authorXinchen Hui <laruence@gmail.com>
Tue, 12 Jul 2016 04:14:45 +0000 (12:14 +0800)
committerXinchen Hui <laruence@gmail.com>
Tue, 12 Jul 2016 04:14:45 +0000 (12:14 +0800)
NEWS
Zend/zend_exceptions.c
ext/standard/tests/serialize/bug69152.phpt
ext/standard/tests/serialize/bug69793.phpt

diff --git a/NEWS b/NEWS
index 2b21a03c0ee17ab64d99f83e65fc16d469b86221..5da0c578ebd8fb9bd9a8265da06bfcbc2c9d77a5 100644 (file)
--- 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:
index 66476a15172fcbbe5163fe010d1762e77c96eb0f..fda4d21e032bfc5191b2f74b61ec99dd3d83c2d0 100644 (file)
@@ -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); \
index bc2b302ddb75da9cfacea209287a732d8cdaf2bb..4e741685ccd043ede839e898e3952cbaddafae59 100644 (file)
@@ -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}
index 624f1ac740103461c8481f635a39cd6c2151c8c1..b5784b89eb3590af5e06da6402a1e0435fab2772 100644 (file)
@@ -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