php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62582 xmlrpc_server_* should handle exceptions
Submitted: 2012-07-16 21:16 UTC Modified: 2021-04-13 13:54 UTC
From: gmblar+php at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: XMLRPC-EPI related
PHP Version: 5.4.4 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gmblar+php at gmail dot com
New email:
PHP Version: OS:

 

 [2012-07-16 21:16 UTC] gmblar+php at gmail dot com
Description:
------------
xmlrpc_server_* should handle exceptions and return a xmlrpc fault

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

$xmlrpc = xmlrpc_server_create();
xmlrpc_server_register_method($xmlrpc, 'foo.bar', function() {
    throw new Exception('foobar', 42);
});

$request = xmlrpc_encode_request('foo.bar', array());
$result = xmlrpc_server_call_method($xmlrpc, $request, array());
echo $result;


Expected result:
----------------
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<fault>
 <value>
  <struct>
   <member>
    <name>faultString</name>
    <value>
     <string>foobar</string>
    </value>
   </member>
   <member>
    <name>faultCode</name>
    <value>
     <int>42</int>
    </value>
   </member>
  </struct>
 </value>
</fault>
</methodResponse>


Actual result:
--------------
Fatal error: Uncaught exception 'Exception' with message 'foobar' in -:5
Stack trace:
#0 [internal function]: {closure}('foo.bar', Array, Array)
#1 -(9): xmlrpc_server_call_method(Resource id #1, '<?xml version="...', Array)
#2 {main}
  thrown in - on line 5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-24 20:16 UTC] gmblar+php at gmail dot com
-Package: *XML functions +Package: XMLRPC-EPI related
 [2012-07-24 20:16 UTC] gmblar+php at gmail dot com
Change package
 [2021-04-13 13:54 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-04-13 13:54 UTC] cmb@php.net
The xmlrpc extension is unbundled and moved to PECL as of PHP
7.4.0.  I'm temporarily maintaining the extension, but I will not
do any feature additions.  Actually, everybody is likely better
off to switch to something else.  Thus, I'm closing this ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC