PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » XML_RPC » Bug #3658

missing isset() test resulting in error (Server.php line 414)

Details

Submitted2005-03-01 10:10 UTC
Frommsmulders at pronexus dot nl
Assigneddanielc
StatusClosed
PackageXML_RPC
PHP Version4.3.10
OSGNU-Linux and Win2003
Roadmaps(Not assigned)

Comments

[2005-03-01 10:10 UTC] msmulders at pronexus dot nl

Description:
------------
If an XMLRPC client calls an unknown method, the Server.php will issue an "undefined index" notice on line 414.
It seems on line 414 the call: is_string($dmap[$methName]['function']) tries to access the dispmap array without checking the $methName member using isset()

Reproduce code:
---------------
Just initiate an XMLRPC server with empty dispmap; then as client do:

require_once('XML/RPC.php');
$RPC =& new XML_RPC_Client ("/path/to/xmlrpc.php", "http://myhost.com", 80);

$RPC->SetDebug(1);

$rpc_msg = new XML_RPC_Message("Non.Existent.Method", array());

Expected result:
----------------
I expect to get a valid XMLRPC response with faultcode 1 (unknown method) without the PHP notice

Actual result:
--------------
<br />
<b>Notice</b>: Undefined index: Non.Existent.Method in <b>/usr/lib/php/XML/RPC/Server.php</b> on line <b>414</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /usr/lib/php/XML/RPC/Server.php:414) in <b>/usr/lib/php/XML/RPC/Server.php</b> on line <b>315</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /usr/lib/php/XML/RPC/Server.php:414) in <b>/usr/lib/php/XML/RPC/Server.php</b> on line <b>316</b><br />