summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-26 15:32:18 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-06-05 14:25:07 +0200
commita31f46421d7bf6f55dd9ac5876b8e2eacf7e0708 (patch)
tree24ffd7c5ae5e321c3994048fdd0fd9f68ae7457c /ext/zip/php_zip.c
parent528aa7932a839fc6319979c34aa372805d8dc41c (diff)
downloadphp-git-a31f46421d7bf6f55dd9ac5876b8e2eacf7e0708.tar.gz
Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index df3eade995..c2b41309c0 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -876,6 +876,9 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
ZVAL_STR(&tmp_member, zval_get_string_func(member));
member = &tmp_member;
cache_slot = NULL;
+ if (EG(exception)) {
+ return NULL;
+ }
}
obj = Z_ZIP_P(object);
@@ -907,6 +910,9 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
ZVAL_STR(&tmp_member, zval_get_string_func(member));
member = &tmp_member;
cache_slot = NULL;
+ if (EG(exception)) {
+ return &EG(uninitialized_zval);
+ }
}
obj = Z_ZIP_P(object);
@@ -943,6 +949,9 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
ZVAL_STR(&tmp_member, zval_get_string_func(member));
member = &tmp_member;
cache_slot = NULL;
+ if (EG(exception)) {
+ return 0;
+ }
}
obj = Z_ZIP_P(object);