php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72647 xmlrpc_encode() unexpected output after referencing array elements
Submitted: 2016-07-22 13:29 UTC Modified: -
From: rend at bit dot nl Assigned:
Status: Closed Package: XMLRPC-EPI related
PHP Version: 7.1Git-2016-07-22 (Git) OS: Linux Mint 18 Sarah
Private report: No CVE-ID: None
 [2016-07-22 13:29 UTC] rend at bit dot nl
Description:
------------
Putting an array through xmlrpc_encode() after referencing one or more array elements, results in missing data in the XML output. The referenced elements are excluded.
In this case, the 2nd element of the array ("a") is missing.

Test script:
---------------
<?php

$ar = array(4, "a", 7);
$v = &$ar[1];
unset($v);

echo xmlrpc_encode($ar);

Expected result:
----------------
<?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>

Actual result:
--------------
<?xml version="1.0" encoding="utf-8"?>
<params>
<param>
 <value>
  <array>
   <data>
    <value>
     <int>4</int>
    </value>
    <value>
     <int>7</int>
    </value>
   </data>
  </array>
 </value>
</param>
</params>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-22 15:15 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=692912142324f52341438b39ffe2a5b9bfdd17d0
Log: Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
 [2016-07-22 15:15 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-22 15:16 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=516837344e5de91e2524d503a3f91c4bd9c8dadd
Log: Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=692912142324f52341438b39ffe2a5b9bfdd17d0
Log: Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=516837344e5de91e2524d503a3f91c4bd9c8dadd
Log: Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC