summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-12-22 17:49:20 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-12-22 17:50:04 +0100
commit3237336985dd7c262c51dbb9e8b4b3432982c04e (patch)
treeaae24f9c7de08eaaaffcfa4c28d41f709b36b933
parent2252d8d730dca78d2434ba45b331188ea83b2314 (diff)
parent024637378827ff03ccfb6b903c9d9b968d30af8d (diff)
downloadphp-git-3237336985dd7c262c51dbb9e8b4b3432982c04e.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
-rw-r--r--NEWS4
-rw-r--r--ext/soap/soap.c20
-rw-r--r--ext/soap/tests/bugs/bug70469.phpt20
3 files changed, 24 insertions, 20 deletions
diff --git a/NEWS b/NEWS
index a3607564b2..c828413242 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,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)
+
- Zip:
. Display headers (buildtime) and library (runtime) versions in phpinfo
(with libzip >= 1.3.1). (Remi)
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index f7516c75e4..4835857f3d 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2153,8 +2153,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
char buffer[1024];
size_t buffer_len;
va_list argcopy;
- zend_object **old_objects;
- int old = PG(display_errors);
va_copy(argcopy, args);
buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy);
@@ -2171,24 +2169,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 0000000000..ca3ab80950
--- /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