Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.2

Bug #10186 Error in function serializeval($o)
Submitted: 2007-02-26 02:44 UTC Modified: 2007-02-27 06:06 UTC
From: ivi dot spam at gmail dot com Assigned: danielc
Status: Open Package: XML_RPC (version 1.5.1)
PHP Version: 4.4.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  
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: ivi dot spam at gmail dot com
New email:
PHP Version: Package Version: OS:

 

 [2007-02-26 02:44 UTC] ivi dot spam at gmail dot com (ivi)
Description: ------------ XML RPC not working. Problem in serializeval with Array data Problem in serializeval function in "if (!is_object($o) || empty($o->me) || !is_array($o->me)) { return ''; }" /** * @return string the data in XML format */ function serializeval($o) { if (!is_object($o) || empty($o->me) || !is_array($o->me)) { return ''; } $ar = $o->me; reset($ar); list($typ, $val) = each($ar); return '<value>' . $this->serializedata($typ, $val) . "</value>\n"; } ----------------------------------------- After small changes like /** * @return string the data in XML format */ function serializeval($o) { if (!is_object($o) || empty($o->me) || !is_array($o->me)) { return '<value>' . $o . "</value>\n"; } $ar = $o->me; reset($ar); list($typ, $val) = each($ar); return '<value>' . $this->serializedata($typ, $val) . "</value>\n"; } Working.

Comments

 [2007-02-26 08:16 UTC] danielc (Daniel Convissor)
You need to provide a _short_, _generic_ test script that I can run that demonstrates this specific problem.
 [2007-02-27 06:06 UTC] ivi dot spam at gmail dot com
function returnArray($params) { $arr = array(); $arr[] = 10; $arr[] = 11; $arr[] = 12; $val = new XML_RPC_Value($arr,'array'); return new XML_RPC_Response($val,0); } $serverArr = array(); $serverArr['returnArray']['function']= 'returnArray'; $server = new XML_RPC_Server($serverArr,1); ----------------------------------------- ?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value><array> <data> </data> </array></value> </param> </params> </methodResponse> -------------------------- After changes <?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value><array> <data> <value>10</value> <value>11</value> <value>12</value> </data> </array></value> </param> </params> </methodResponse>