summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-08-30 17:21:13 +0200
committerNikita Popov <nikic@php.net>2016-08-30 17:21:33 +0200
commitb218eb916fcdc4643e082458b567a2f9ef24127f (patch)
treec0ac34a8bd4cfe6d2aa541ce7a12ac5becfb761f
parentecdef60d000210f4d22e95de4209db73a0c8344f (diff)
parent8e487aefaaf88bdad6343da06286bfc86063836c (diff)
downloadphp-git-b218eb916fcdc4643e082458b567a2f9ef24127f.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
-rw-r--r--NEWS4
-rw-r--r--ext/soap/php_encoding.c1
-rw-r--r--ext/soap/tests/bug71996.phpt21
3 files changed, 26 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 9743a32188..fa975caa26 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,10 @@ PHP NEWS
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
SimpleXMLElement). (Nikita)
+- SOAP:
+ . Fixed bug #71996 (Using references in arrays doesn't work like expected).
+ (Nikita)
+
- Standard:
. Fixed bug #72920 (Accessing a private constant using constant() creates
an exception AND warning). (Laruence)
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 7f80b58bd5..58eaeea666 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -2115,6 +2115,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
if (j >= dims[0]) {
break;
}
+ ZVAL_DEREF(zdata);
if (dimension == 1) {
if (enc == NULL) {
xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam);
diff --git a/ext/soap/tests/bug71996.phpt b/ext/soap/tests/bug71996.phpt
new file mode 100644
index 0000000000..c4bb092b22
--- /dev/null
+++ b/ext/soap/tests/bug71996.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #71996: Using references in arrays doesn't work like expected
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$client = new class(null, ['location' => '', 'uri' => 'http://example.org']) extends SoapClient {
+ public function __doRequest($request, $location, $action, $version, $one_way = 0) {
+ echo $request;
+ return '';
+ }
+};
+$ref = array("foo");
+$data = array(&$ref);
+$client->foo($data);
+
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://example.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:foo><param0 SOAP-ENC:arrayType="SOAP-ENC:Array[1]" xsi:type="SOAP-ENC:Array"><item SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">foo</item></item></param0></ns1:foo></SOAP-ENV:Body></SOAP-ENV:Envelope>