mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.0'
* PHP-7.0: Fixed bug #72581 (previous property undefined in Exception after deserialization) Conflicts: Zend/zend_exceptions.c
This commit is contained in:
commit
0478e431cf
2 changed files with 18 additions and 2 deletions
17
Zend/tests/bug72581.phpt
Normal file
17
Zend/tests/bug72581.phpt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #72581 (previous property undefined in Exception after deserialization)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$e = new Exception('aaa', 200);
|
||||||
|
|
||||||
|
$a = serialize($e);
|
||||||
|
|
||||||
|
$b = unserialize($a);
|
||||||
|
|
||||||
|
var_dump($b->__toString());
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
string(%s) "Exception: aaa in %sbug72581.php:%d
|
||||||
|
Stack trace:
|
||||||
|
#0 {main}"
|
|
@ -303,9 +303,8 @@ ZEND_METHOD(exception, __construct)
|
||||||
/* {{{ proto Exception::__wakeup()
|
/* {{{ proto Exception::__wakeup()
|
||||||
Exception unserialize checks */
|
Exception unserialize checks */
|
||||||
#define CHECK_EXC_TYPE(id, type) \
|
#define CHECK_EXC_TYPE(id, type) \
|
||||||
ZVAL_UNDEF(&value); \
|
|
||||||
pvalue = zend_read_property_ex(i_get_exception_base(object), (object), CG(known_strings)[id], 1, &value); \
|
pvalue = zend_read_property_ex(i_get_exception_base(object), (object), CG(known_strings)[id], 1, &value); \
|
||||||
if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
|
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
|
||||||
zval tmp; \
|
zval tmp; \
|
||||||
ZVAL_STR_COPY(&tmp, CG(known_strings)[id]); \
|
ZVAL_STR_COPY(&tmp, CG(known_strings)[id]); \
|
||||||
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
|
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue