diff options
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r-- | ext/mysqli/mysqli.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index f9404af4d8..ba12ea1a80 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -67,7 +67,7 @@ zend_class_entry *mysqli_warning_class_entry; zend_class_entry *mysqli_exception_class_entry; -typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv); +typedef int (*mysqli_read_t)(mysqli_object *obj, zval *rv, zend_bool quiet); typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval); typedef struct _mysqli_prop_handler { @@ -279,10 +279,13 @@ static void mysqli_warning_free_storage(zend_object *object) /* }}} */ /* {{{ mysqli_read_na */ -static zval *mysqli_read_na(mysqli_object *obj, zval *retval) +static int mysqli_read_na(mysqli_object *obj, zval *retval, zend_bool quiet) { - zend_throw_error(NULL, "Cannot read property"); - return NULL; + if (!quiet) { + zend_throw_error(NULL, "Cannot read property"); + } + + return FAILURE; } /* }}} */ @@ -290,6 +293,7 @@ static zval *mysqli_read_na(mysqli_object *obj, zval *retval) static int mysqli_write_na(mysqli_object *obj, zval *newval) { zend_throw_error(NULL, "Cannot write property"); + return FAILURE; } /* }}} */ @@ -308,8 +312,9 @@ zval *mysqli_read_property(zend_object *object, zend_string *name, int type, voi } if (hnd) { - retval = hnd->read_func(obj, rv); - if (retval == NULL) { + if (hnd->read_func(obj, rv, type == BP_VAR_IS) == SUCCESS || type != BP_VAR_IS) { + retval = rv; + } else { retval = &EG(uninitialized_zval); } } else { |