diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-26 15:32:18 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-05 14:25:07 +0200 |
| commit | a31f46421d7bf6f55dd9ac5876b8e2eacf7e0708 (patch) | |
| tree | 24ffd7c5ae5e321c3994048fdd0fd9f68ae7457c /ext/pdo_firebird/firebird_driver.c | |
| parent | 528aa7932a839fc6319979c34aa372805d8dc41c (diff) | |
| download | php-git-a31f46421d7bf6f55dd9ac5876b8e2eacf7e0708.tar.gz | |
Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions
And convert some object to string conversion related recoverable
fatal errors into Error exceptions.
Improve exception safety of internal code performing string
conversions.
Diffstat (limited to 'ext/pdo_firebird/firebird_driver.c')
| -rw-r--r-- | ext/pdo_firebird/firebird_driver.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 6c83717e65..a4ff7e5c5a 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -466,6 +466,9 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v case PDO_FB_ATTR_DATE_FORMAT: { zend_string *str = zval_get_string(val); + if (EG(exception)) { + return 0; + } if (H->date_format) { efree(H->date_format); } @@ -477,6 +480,9 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v case PDO_FB_ATTR_TIME_FORMAT: { zend_string *str = zval_get_string(val); + if (EG(exception)) { + return 0; + } if (H->time_format) { efree(H->time_format); } @@ -488,6 +494,9 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v case PDO_FB_ATTR_TIMESTAMP_FORMAT: { zend_string *str = zval_get_string(val); + if (EG(exception)) { + return 0; + } if (H->timestamp_format) { efree(H->timestamp_format); } |
