]> granicus.if.org Git - php/commitdiff
Fixed call to mysqli_init() from an object. (We should find some better fix)
authorDmitry Stogov <dmitry@zend.com>
Wed, 11 Jun 2014 20:57:10 +0000 (00:57 +0400)
committerDmitry Stogov <dmitry@zend.com>
Wed, 11 Jun 2014 20:57:10 +0000 (00:57 +0400)
ext/mysqli/mysqli_api.c

index 1b2c7998b224beb584528c6b5b40cde635013af1..f5dd2749d11201b5a58b0f3abb95fa77d868eefd 100644 (file)
@@ -1475,7 +1475,14 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
        MYSQLI_RESOURCE *mysqli_resource;
        MY_MYSQL *mysql;
 
-       if (getThis() && (Z_MYSQLI_P(getThis()))->ptr) {
+// TODO: We can't properly check if this was to mysql_init() in a class method 
+//       or a call to mysqli->init().
+//       To solve the problem, we added instanceof check for the class of $this
+//       ???
+       if (getThis() &&
+           instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC) &&
+           (Z_MYSQLI_P(getThis()))->ptr) {
+//???  if (getThis() && (Z_MYSQLI_P(getThis()))->ptr) {
                return;
        }