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 /win32 | |
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 'win32')
-rw-r--r-- | win32/codepage.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/codepage.c b/win32/codepage.c index 86a4c33007..48f60595b4 100644 --- a/win32/codepage.c +++ b/win32/codepage.c @@ -657,7 +657,9 @@ PHP_FUNCTION(sapi_windows_cp_conv) RETURN_NULL(); } } else { - convert_to_string(z_in_cp); + if (!try_convert_to_string(z_in_cp)) { + return; + } in_cp = php_win32_cp_get_by_enc(Z_STRVAL_P(z_in_cp)); if (!in_cp) { @@ -678,7 +680,9 @@ PHP_FUNCTION(sapi_windows_cp_conv) RETURN_NULL(); } } else { - convert_to_string(z_out_cp); + if (!try_convert_to_string(z_out_cp)) { + return; + } out_cp = php_win32_cp_get_by_enc(Z_STRVAL_P(z_out_cp)); if (!out_cp) { |