[eluser]Elliot Haughin[/eluser]
OK, So I've triple checked that this is actually a bug, and it is.
I'm currently using CI's XMLRPC Library to communicate with a Java XML-RPC Server.
The method I am using requires data in the following structure:
string userToken
Date from
Date to
The dates are iso8601 dates.
So, here's the controller:
Code:
function games_played($from = null, $to = null)
{
if ( empty($from) || empty($to) )
{
$from = $this->from;
$to = $this->to;
}
$request = array(
array( $this->api->user_token, 'string' ),
array( date('Ymd\TH:i:s', $from), 'dateTime.iso8601' ),
array( date('Ymd\TH:i:s', $to), 'dateTime.iso8601' )
);
if ( $games_played = $this->api->call('AdminAPI.getTotalGamesPlayed', $request) )
{
return $games_played;
}
else
{
}
}
Now, the problem is, that the 'dateTime.iso8601' is completely ignored, and those vars get sent as strings.
I've run through the library and found exactly where the error occurs:
Line 234 (Xmlrpc.php)
Code:
if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1']])))
The test first lowers the datatype in the comparison, which fails, because the xmlrpcTypes array has a dateTime.iso8601 as the key, not datetime.iso8601 (lower case).
The possible fixes are:
Change line 41 from:
Code:
var $xmlrpcDateTime = 'dateTime.iso8601';
to:
Code:
var $xmlrpcDateTime = 'datetime.iso8601';
then fix any errors that causes....
Or, just remove the strtolower on line 234.
I know this is a pretty specific and unusual bug, but I'm using this library for all of my code at work, so it's pretty important.