summaryrefslogtreecommitdiff
path: root/ext/sqlite3
diff options
context:
space:
mode:
authorEtienne Kneuss <colder@php.net>2008-11-19 02:00:53 (GMT)
committerEtienne Kneuss <colder@php.net>2008-11-19 02:00:53 (GMT)
commit3919b16f041a50ab279c02c5eabfa0483dbfb0d0 (patch)
tree37e5b1b9e5be276bddc38ce1ac6956f1fe005b2a /ext/sqlite3
parent202426a1fbff9cbc29bec564ddb29a2972e90e69 (diff)
downloadphp-3919b16f041a50ab279c02c5eabfa0483dbfb0d0.tar.gz
MFH: Fix #46241 (stacked error_handlers, error_handling in general)
Diffstat (limited to 'ext/sqlite3')
-rw-r--r--ext/sqlite3/sqlite3.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 8f36786..1506cef 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1179,11 +1179,13 @@ PHP_METHOD(sqlite3stmt, __construct)
zval *db_zval;
char *sql;
int sql_len, errcode;
+ zend_error_handling error_handling;
stmt_obj = (php_sqlite3_stmt *)zend_object_store_get_object(object TSRMLS_CC);
- zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &db_zval, php_sqlite3_sc_entry, &sql, &sql_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -1191,6 +1193,8 @@ PHP_METHOD(sqlite3stmt, __construct)
SQLITE3_CHECK_INITIALIZED(db_obj->initialised, SQLite3)
+ zend_restore_error_handling(&error_handling TSRMLS_CC);
+
if (!sql_len) {
RETURN_FALSE;
}
@@ -1377,11 +1381,14 @@ PHP_METHOD(sqlite3result, __construct)
php_sqlite3_result *result_obj;
zval *object = getThis();
result_obj = (php_sqlite3_result *)zend_object_store_get_object(object TSRMLS_CC);
+ zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLite3Result cannot be directly instantiated");
+ zend_restore_error_handling(&error_handling TSRMLS_CC);
+
}
/* }}} */