summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-12-27 22:20:56 +0000
committerMarcus Boerger <helly@php.net>2003-12-27 22:20:56 +0000
commit879184bd6da1af05921af7abcda5b0cd59044c75 (patch)
treebbcc58f336cefaaff3d0b25332a40fe9e8d6ad4f
parent02de761345098efa4fc5ffc297df289a383e44a4 (diff)
downloadphp-git-879184bd6da1af05921af7abcda5b0cd59044c75.tar.gz
Fixed Bug #25329 sqlite_create_function with method and reference to $this
-rw-r--r--ext/sqlite/sqlite.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index e4ba80f4ac..7c498e3e5d 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -261,22 +261,20 @@ static ZEND_RSRC_DTOR_FUNC(php_sqlite_result_dtor)
static int php_sqlite_forget_persistent_id_numbers(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
- struct php_sqlite_db *db;
+ struct php_sqlite_db *db = (struct php_sqlite_db*)rsrc->ptr;
+ /* prevent bad mojo if someone tries to use a previously registered function in the next request */
+ zend_hash_apply(&db->callbacks, (apply_func_t)php_sqlite_callback_invalidator TSRMLS_CC);
+
if (Z_TYPE_P(rsrc) != le_sqlite_pdb) {
return 0;
}
- db = (struct php_sqlite_db*)rsrc->ptr;
-
db->rsrc_id = FAILURE;
/* don't leave pending commits hanging around */
sqlite_exec(db->db, "ROLLBACK", NULL, NULL, NULL);
- /* prevent bad mojo if someone tries to use a previously registered function in the next request */
- zend_hash_apply(&db->callbacks, (apply_func_t)php_sqlite_callback_invalidator TSRMLS_CC);
-
return 0;
}