]> granicus.if.org Git - php/commitdiff
Allow static methods being called from sqlite sql. Notice by Stphane Mariel
authorMarcus Boerger <helly@php.net>
Sat, 25 Oct 2003 23:17:15 +0000 (23:17 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 25 Oct 2003 23:17:15 +0000 (23:17 +0000)
ext/sqlite/sqlite.c

index 0c94267e0252658b26b7675feb8c3f7cf78f119c..a6bb92c5f8c0a84795a32e28c28a01e25a00bbf6 100644 (file)
@@ -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) {