php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38429 xmlrpc server returns invalid fault response on bad user code
Submitted: 2006-08-11 13:31 UTC Modified: 2011-02-21 21:24 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: giunta dot gaetano at sea-aeroportimilano dot it Assigned:
Status: Open Package: XMLRPC-EPI related
PHP Version: 5.1.4 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: giunta dot gaetano at sea-aeroportimilano dot it
New email:
PHP Version: OS:

 

 [2006-08-11 13:31 UTC] giunta dot gaetano at sea-aeroportimilano dot it
Description:
------------
When registering a php user function to be exposed as xmlrpc method, the resulting xml will be that of an xmlrpc fault response iff the return value of the user function is an array containing a key 'faultCode'.

When the result value contains other array members beside faultCode and faultString, or the values of those two members are not an int and a string, the generated xml will not be conforming to the xmlrpc spec, which states: "A <fault> struct may not contain members other than those specified".

I know that this situation is the fault of the coder, but, imho, the lib should do its reasonable best to always work within the spec...


Reproduce code:
---------------
$x = xmlrpc_server_create();
xmlrpc_server_register_method($x, 'pluto', 'pippo');
$out = xmlrpc_server_call_method($x, xmlrpc_encode_request('pluto', array()), null);
echo htmlspecialchars($out);

function pippo($meth, $params, $extras)
{
return array('faultCode' => 1, 'faultString' => array(1, 2, 3, 4), 'hello world');
}

Actual result:
--------------
<?xml version="1.0" encoding="iso-8859-1"?> <methodResponse> <params> <value> <struct> <member> <name>faultCode</name> <value> <int>1</int> </value> </member> <member> <name>faultString</name> <value> <array> <data> <value> <int>1</int> </value> <value> <int>2</int> </value> <value> <int>3</int> </value> <value> <int>4</int> </value> </data> </array> </value> </member> <member> <name/> <value> <string>hello world</string> </value> </member> </struct> </value> </params> </methodResponse>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-21 21:24 UTC] jani@php.net
-Package: Feature/Change Request +Package: XMLRPC-EPI related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 03:01:26 2019 UTC