mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
MFH Error handler isn't properly restored when using fetchObject() with SQLite
This commit is contained in:
parent
2d73897856
commit
7ba273e3b5
1 changed files with 6 additions and 2 deletions
|
@ -114,16 +114,20 @@ PHP_INI_END()
|
|||
} \
|
||||
}
|
||||
|
||||
#define RES_FROM_OBJECT(res, object) \
|
||||
#define RES_FROM_OBJECT_RESTORE_ERH(res, object, error_handling) \
|
||||
{ \
|
||||
sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC); \
|
||||
res = obj->u.res; \
|
||||
if (!res) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No result set available"); \
|
||||
if (error_handling) \
|
||||
zend_restore_error_handling(error_handling TSRMLS_CC); \
|
||||
RETURN_NULL(); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define RES_FROM_OBJECT(res, object) RES_FROM_OBJECT_RESTORE_ERH(res, object, NULL)
|
||||
|
||||
#define PHP_SQLITE_EMPTY_QUERY \
|
||||
if (!sql_len) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute empty query."); \
|
||||
|
@ -2369,7 +2373,7 @@ PHP_FUNCTION(sqlite_fetch_object)
|
|||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
RES_FROM_OBJECT(res, object);
|
||||
RES_FROM_OBJECT_RESTORE_ERH(res, object, &error_handling);
|
||||
if (!ZEND_NUM_ARGS()) {
|
||||
ce = zend_standard_class_def;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue