diff --git a/NEWS b/NEWS
index bf1e53ff736..4aea171c1f6 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2018, PHP 7.2.13
+- SOAP:
+ . Fixed bug #50675 (SoapClient can't handle object references correctly).
+ (Cameron Porter)
08 Nov 2018, PHP 7.2.12
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 2da75a3e2e2..6051995713e 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -298,8 +298,6 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
if (node_ptr == node) {
return 0;
}
- xmlNodeSetName(node, node_ptr->name);
- xmlSetNs(node, node_ptr->ns);
if (SOAP_GLOBAL(soap_version) == SOAP_1_1) {
while (1) {
attr = get_attribute(attr, "id");
diff --git a/ext/soap/tests/bugs/bug50675.phpt b/ext/soap/tests/bugs/bug50675.phpt
new file mode 100644
index 00000000000..c5feb173ace
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50675.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #50675 SoapClient can't handle object references correctly.
+--SKIPIF--
+
+--FILE--
+
+
+
+
+ soapenv:Server.userException
+ service.EchoServiceException
+
+
+ 105
+ string param
+
+ steckovic
+
+
+
+
+EOF;
+ }
+}
+
+ini_set('soap.wsdl_cache_enabled', 0);
+
+$parameters = [
+ 'trace' => 1,
+ 'exceptions' => 0,
+];
+$client = new TestSoapClient(dirname(__FILE__) . '/bug50675.wsdl', $parameters);
+
+$person = new stdClass();
+$person->name = 'name';
+
+$result = $client->echoPerson($person, $person);
+
+print($client->__getLastRequest());
+--EXPECT--
+
+name
diff --git a/ext/soap/tests/bugs/bug50675.wsdl b/ext/soap/tests/bugs/bug50675.wsdl
new file mode 100644
index 00000000000..998fe9fce64
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50675.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+