Home » Web Services » XML_RPC » Bug #3658
missing isset() test resulting in error (Server.php line 414)
Details
| Submitted | 2005-03-01 10:10 UTC |
|---|---|
| From | msmulders at pronexus dot nl |
| Assigned | danielc |
| Status | Closed |
| Package | XML_RPC |
| PHP Version | 4.3.10 |
| OS | GNU-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 />