From: Nikita Popov Date: Tue, 30 Aug 2016 15:19:19 +0000 (+0200) Subject: Fixed bug #71996 X-Git-Tag: php-7.1.0RC1~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e487aefaaf88bdad6343da06286bfc86063836c;p=php Fixed bug #71996 --- diff --git a/NEWS b/NEWS index 36b01a3453..37daabe74a 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - mbstring: . Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb) +- SOAP: + . Fixed bug #71996 (Using references in arrays doesn't work like expected). + (Nikita) + - Standard: . Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory). (cmb) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index fc389f2365..9c9e4e9e56 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2120,6 +2120,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-- + +--FILE-- + '', '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-- + +foo