Show
Ignore:
Timestamp:
09/08/08 01:27:12 (4 months ago)
Author:
dmondark
Message:

Avoid raising an error if a call with no parameters is made in xmlrpc server. Thanks scoates for the fix and the commit message ;)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/xmlrpcserver.php

    r737 r2457  
    2020        } 
    2121        $input= file_get_contents( 'php://input' ); 
    22          
     22 
    2323        $xml= new SimpleXMLElement( $input ); 
    24          
     24 
    2525        $function = $xml->methodName; 
    2626        $params= array(); 
    27         foreach($xml->xpath('//params/param/value') as $param) { 
    28             $params[] = XMLRPCUtils::decode_args($param); 
     27        $foundParams= $xml->xpath( '//params/param/value' ); 
     28        if ( is_array( $foundParams ) ) { 
     29            foreach( $foundParams as $param ) { 
     30                $params[]= XMLRPCUtils::decode_args( $param ); 
     31            } 
    2932        } 
    3033 
    3134        $returnvalue= false; 
    32          
     35 
    3336        Plugins::register(array($this, 'system_listMethods'), 'xmlrpc', 'system.listMethods'); 
    3437        $returnvalue = Plugins::xmlrpc("{$function}", $returnvalue, $params, $this);