mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
This commit is contained in:
parent
9a2207c90a
commit
516837344e
5
NEWS
5
NEWS
@ -81,6 +81,11 @@ PHP NEWS
|
||||
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
|
||||
UTF chars). (cmb)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
|
||||
array elements). (Laruence)
|
||||
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
|
||||
|
||||
|
36
ext/xmlrpc/tests/bug72647.phpt
Normal file
36
ext/xmlrpc/tests/bug72647.phpt
Normal file
@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("xmlrpc")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$ar = array(4, "a", 7);
|
||||
$v = &$ar[1];
|
||||
unset($v);
|
||||
|
||||
echo xmlrpc_encode($ar);
|
||||
?>
|
||||
--EXPECTF--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<array>
|
||||
<data>
|
||||
<value>
|
||||
<int>4</int>
|
||||
</value>
|
||||
<value>
|
||||
<string>a</string>
|
||||
</value>
|
||||
<value>
|
||||
<int>7</int>
|
||||
</value>
|
||||
</data>
|
||||
</array>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
@ -568,6 +568,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
|
||||
xReturn = XMLRPC_CreateVector(key, vtype);
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(val_arr), num_index, my_key, pIter) {
|
||||
ZVAL_DEREF(pIter);
|
||||
ht = HASH_OF(pIter);
|
||||
if (ht) {
|
||||
ht->u.v.nApplyCount++;
|
||||
|
Loading…
Reference in New Issue
Block a user