diff options
author | Antony Dovgal <tony2001@php.net> | 2006-07-05 11:48:30 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-07-05 11:48:30 +0000 |
commit | 0f8f945418ae8ce9091327a8ac81501cf35b51c5 (patch) | |
tree | d1be2e91248e88fc00210aab53e433eb2c37f7d2 | |
parent | c4c96c042e9a99b95731d7f387fd794cab58d55f (diff) | |
download | php-git-0f8f945418ae8ce9091327a8ac81501cf35b51c5.tar.gz |
MFH: fix bug #38003(in classes inherited from mysqli it's possible to call private constructors from invalid context)
-rw-r--r-- | ext/mysqli/mysqli.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index cd7121046d..39ba897b7e 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -293,11 +293,12 @@ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) { mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); + zend_class_entry * ce = Z_OBJCE_P(object); - if (obj->zo.ce != mysqli_link_class_entry && obj->zo.ce != mysqli_stmt_class_entry && - obj->zo.ce != mysqli_result_class_entry && obj->zo.ce != mysqli_driver_class_entry && - obj->zo.ce != mysqli_warning_class_entry) { - return obj->zo.ce->constructor; + if (ce != mysqli_link_class_entry && ce != mysqli_stmt_class_entry && + ce != mysqli_result_class_entry && ce != mysqli_driver_class_entry && + ce != mysqli_warning_class_entry) { + return zend_std_get_constructor(object TSRMLS_CC); } else { static zend_internal_function f; |