]> granicus.if.org Git - php/commitdiff
fix bug #38003(in classes inherited from mysqli it's possible to call private constru...
authorAntony Dovgal <tony2001@php.net>
Wed, 5 Jul 2006 11:48:17 +0000 (11:48 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 5 Jul 2006 11:48:17 +0000 (11:48 +0000)
also, use appropriate macro instead of accessing structure elements directly

ext/mysqli/mysqli.c

index dea04b70ba1a06ac8303b0c4ae8241f5c29088f8..213bb47e402c7c0671e5b88c817d49876d36ed77 100644 (file)
@@ -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;