com php-src: Fixed bug #70469: NEWS ext/soap/soap.c ext/soap/tests/bugs/bug70469.phpt
| From: | Nikita Popov | Date: | Fri, 22 Dec 2017 16:47:54 +0000 |
| Subject: | com php-src: Fixed bug #70469: NEWS ext/soap/soap.c ext/soap/tests/bugs/bug70469.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100666@lists.php.net to get a copy of this message | ||
Commit: 024637378827ff03ccfb6b903c9d9b968d30af8d
Author: Anton Artamonov <a.artmnv@gmail.com> Sat, 4 Nov 2017 19:51:33 +0700
Committer: Nikita Popov <nikita.ppv@gmail.com> Fri, 22 Dec 2017 17:47:54 +0100
Parents: 77b0e2fd3f5e76f12bdd4a66f64e553bc35cb37d
Branches: PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=024637378827ff03ccfb6b903c9d9b968d30af8d
Log:
Fixed bug #70469
Don't generate an E_ERROR if we've already thrown an exception.
This interacts badly with error_get_last() checks.
Bugs:
https://bugs.php.net/70469
Changed paths:
M NEWS
M ext/soap/soap.c
A ext/soap/tests/bugs/bug70469.phpt
Diff:
diff --git a/NEWS b/NEWS
index 0b3cd7e..2483bd6 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,10 @@ PHP NEWS
. Fixed bug #75671 (pg_version() crashes when called on a connection to
cockroach). (magicaltux at gmail dot com)
+- SOAP:
+ . Fixed bug #70469 (SoapClient generates E_ERROR even if exceptions=1 is
+used). (Anton Artamonov)
+
04 Jan 2018, PHP 7.1.13
- Core:
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 54ddaf0..c2b8474 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2166,8 +2166,6 @@ static void soap_error_handler(int error_num, const char *error_filename,
const
#ifdef va_copy
va_list argcopy;
#endif
- zend_object **old_objects;
- int old = PG(display_errors);
#ifdef va_copy
va_copy(argcopy, args);
@@ -2187,24 +2185,6 @@ static void soap_error_handler(int error_num, const char *error_filename,
const
add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL);
Z_ADDREF(fault);
zend_throw_exception_object(&fault);
-
- old_objects = EG(objects_store).object_buckets;
- EG(objects_store).object_buckets = NULL;
- PG(display_errors) = 0;
- SG(sapi_headers).http_status_line = NULL;
- zend_try {
- call_old_error_handler(error_num, error_filename, error_lineno, format, args);
- } zend_catch {
- CG(in_compilation) = _old_in_compilation;
- EG(current_execute_data) = _old_current_execute_data;
- if (SG(sapi_headers).http_status_line) {
- efree(SG(sapi_headers).http_status_line);
- }
- SG(sapi_headers).http_status_line = _old_http_status_line;
- SG(sapi_headers).http_response_code = _old_http_response_code;
- } zend_end_try();
- EG(objects_store).object_buckets = old_objects;
- PG(display_errors) = old;
zend_bailout();
} else if (!use_exceptions ||
!SOAP_GLOBAL(error_code) ||
diff --git a/ext/soap/tests/bugs/bug70469.phpt b/ext/soap/tests/bugs/bug70469.phpt
new file mode 100644
index 0000000..ca3ab80
--- /dev/null
+++ b/ext/soap/tests/bugs/bug70469.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #70469 (SoapClient should not generate E_ERROR if exceptions enabled)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+try {
+ $x = new SoapClient('http://i_dont_exist.com/some.wsdl');
+} catch (SoapFault $e) {
+ echo "catched\n";
+}
+
+$error = error_get_last();
+if ($error === null) {
+ echo "ok\n";
+}
+?>
+--EXPECT--
+catched
+ok
\ No newline at end of file