|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48670 xmlrpc_decode() decodes Hashtable response with integer key incorrectly
Submitted: 2009-06-24 02:12 UTC Modified: 2009-11-24 20:34 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zhangsilly at gmail dot com Assigned:
Status: Not a bug Package: XMLRPC-EPI related
PHP Version: 5.2.10 OS: Windows XP
Private report: No CVE-ID: None
 [2009-06-24 02:12 UTC] zhangsilly at gmail dot com
xmlrpc_decode decode hashtable response with integer key will ignore the key, just decode the same result as Vector.

Reproduce code:
ws-apache encode the Hashtable<Integer, String> as xmlrpc_decode's parameter:
print_r(xmlrpc_decode('<?xml version="1.0" encoding="UTF-8"?><methodResponse xmlns:ex=""><params><param><value><struct><member><name><value><i4>3</i4></value></name><value>wps2000</value></member><member><name><value><i4>0</i4></value></name><value>ddr</value></member></struct></value></param></params></methodResponse>'));

I format the xml response here:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse xmlns:ex="">

It seems the xmlrpc_decode just take Hashtable<Integer, Object> as Vector<Object>

Expected result:
    3  => wps2000
    0  => ddr

Actual result:
    [0] => wps2000
    [1] => ddr


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-24 20:34 UTC]
More recent, same issue: bug #50285

Closing this in favor of the newer report. 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Sep 25 11:05:53 2022 UTC