summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite_driver.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-06-26 17:22:01 +0200
committerRemi Collet <remi@php.net>2017-06-26 17:22:01 +0200
commit85c32322acfc07628140bf631e7c52b12e6050b4 (patch)
treeae79035283e68957177407123d7d342278e021d9 /ext/pdo_sqlite/sqlite_driver.c
parent4ed8ff509001b35e0cb971a1d6a294345c5d7673 (diff)
parentcaaeb4849aa56cbbdc66ea015c11a58bd47a43ff (diff)
downloadphp-git-85c32322acfc07628140bf631e7c52b12e6050b4.tar.gz
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (24 commits) Removed EG(valid_symbol_table). Used EG(active) instead. Release temporary string reference Remove superfluous semicolons Fix tests on Windows Produce a better exception message when IntlDateFormatter constructor fails. Fix format arguments Remove unused variable op2. It is redeclared later. Fix typo Implement object type annotation Fixed bug #73173 Expose inflate_get_status() and inflate_get_read_len() functions Add more constants, improve comments, and add tests Fixed bug #73900 Add OPENSSL_DONT_ZERO_PAD_KEY constant to prevent key padding Drop soap_hash_str_find_deref() Only compute callback name in error cases Extract zend_get_callable_name() API Move va_copy compatibility code into zend_portability.h Remove unnecessary string copy Fix FE_FETCH_* exception check ...
Diffstat (limited to 'ext/pdo_sqlite/sqlite_driver.c')
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index fed9dbed2f..3d32f232e8 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -515,7 +515,6 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
size_t func_name_len;
zend_long argc = -1;
zend_long flags = 0;
- zend_string *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H;
int ret;
@@ -531,12 +530,12 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname)) {
+ if (!zend_is_callable(callback, 0, NULL)) {
+ zend_string *cbname = zend_get_callable_name(callback);
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(cbname));
zend_string_release(cbname);
RETURN_FALSE;
}
- zend_string_release(cbname);
H = (pdo_sqlite_db_handle *)dbh->driver_data;
@@ -588,7 +587,6 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
char *func_name;
size_t func_name_len;
zend_long argc = -1;
- zend_string *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H;
int ret;
@@ -604,18 +602,19 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(step_callback, 0, &cbname)) {
+ if (!zend_is_callable(step_callback, 0, NULL)) {
+ zend_string *cbname = zend_get_callable_name(step_callback);
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(cbname));
zend_string_release(cbname);
RETURN_FALSE;
}
- zend_string_release(cbname);
- if (!zend_is_callable(fini_callback, 0, &cbname)) {
+
+ if (!zend_is_callable(fini_callback, 0, NULL)) {
+ zend_string *cbname = zend_get_callable_name(fini_callback);
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(cbname));
zend_string_release(cbname);
RETURN_FALSE;
}
- zend_string_release(cbname);
H = (pdo_sqlite_db_handle *)dbh->driver_data;
@@ -651,7 +650,6 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
zval *callback;
char *collation_name;
size_t collation_name_len;
- zend_string *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H;
int ret;
@@ -664,12 +662,12 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname)) {
+ if (!zend_is_callable(callback, 0, NULL)) {
+ zend_string *cbname = zend_get_callable_name(callback);
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(cbname));
zend_string_release(cbname);
RETURN_FALSE;
}
- zend_string_release(cbname);
H = (pdo_sqlite_db_handle *)dbh->driver_data;