com php-src: Fixed call to mysqli_init() from an ob ject. (We should find some better fix): e xt/mysqli/mysqli_api.c
| From: | Dmitry Stogov | Date: | Wed, 11 Jun 2014 20:57:10 +0000 |
| Subject: | com php-src: Fixed call to mysqli_init() from an ob ject. (We should find some better fix): e xt/mysqli/mysqli_api.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78845@lists.php.net to get a copy of this message | ||
Commit: edb064e2eea732e44fb2b9dd5b91fd532bf92654
Author: Dmitry Stogov <dmitry@zend.com> Thu, 12 Jun 2014 00:57:10 +0400
Parents: bccd4184a59cce6b4d0e3aff7fb20ac1ead0f0be
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=edb064e2eea732e44fb2b9dd5b91fd532bf92654
Log:
Fixed call to mysqli_init() from an object. (We should find some better fix)
Changed paths:
M ext/mysqli/mysqli_api.c
Diff:
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 1b2c799..f5dd274 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -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;
}