From: Marcus Boerger Date: Sat, 25 Oct 2003 23:17:15 +0000 (+0000) Subject: Allow static methods being called from sqlite sql. Notice by Stphane Mariel X-Git-Tag: RELEASE_2_0_0RC1~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37f6618c64bf83634831f01a0e37e55283cdd103;p=php Allow static methods being called from sqlite sql. Notice by Stphane Mariel --- diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 0c94267e02..a6bb92c5f8 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -413,13 +413,14 @@ static void php_sqlite_generic_function_callback(sqlite_func *func, int argc, co return; } - ZVAL_STRING(&funcname, (char*)argv[0], 0); + ZVAL_STRING(&funcname, (char*)argv[0], 1); - if (!zend_is_callable(&funcname, 0, &callable)) { - spprintf(&errbuf, 0, "function `%s' is not callable", callable); + if (!zend_make_callable(&funcname, &callable TSRMLS_CC)) { + spprintf(&errbuf, 0, "function `%s' is not funcname", callable); sqlite_set_result_error(func, errbuf, -1); efree(errbuf); efree(callable); + zval_dtor(&funcname); return; } efree(callable); @@ -441,6 +442,7 @@ static void php_sqlite_generic_function_callback(sqlite_func *func, int argc, co argc-1, zargs, 0, NULL TSRMLS_CC); + zval_dtor(&funcname); if (res == SUCCESS) { if (retval == NULL) {