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

Bug #17368 struct member name serialization/encoding bug
Submitted: 2010-05-05 15:04 UTC
From: varmando Assigned: doconnor
Status: Closed Package: XML_RPC (version 1.5.3)
PHP Version: 5.2.6 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2010-05-05 15:04 UTC] varmando (Kai Palomäki)
Description: ------------ XML_RPC struct serialization fails to encode member name correctly when name contains XML entities. Test script: --------------- <?php require 'XML/RPC.php'; $param=new XML_RPC_Value(array('foo&bar'=>new XML_RPC_Value('foo & bar company','string')),'struct'); $msg=new XML_RPC_Message('none'); $msg->addParam($param); echo $msg->serialize(); ?> Expected result: ---------------- <?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName>none</methodName> <params> <param> <value><struct> <member><name>foo&bar</name> <value><string>foo & bar company</string></value> </member> </struct></value> </param> </params> </methodCall> Actual result: -------------- <?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName>none</methodName> <params> <param> <value><struct> <member><name>foo&bar</name> <value><string>foo & bar company</string></value> </member> </struct></value> </param> </params> </methodCall>

Comments

 [2010-05-05 15:22 UTC] varmando (Kai Palomäki)
 [2010-05-05 15:25 UTC] varmando (Kai Palomäki)
Expected result: ---------------- <?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName>none</methodName> <params> <param> <value><struct> <member><name>foo&bar</name> <value><string>foo & bar company</string></value> </member> </struct></value> </param> </params> </methodCall> Actual result: -------------- <?xml version="1.0" encoding="UTF-8"?> <methodCall> <methodName>none</methodName> <params> <param> <value><struct> <member><name>foo&bar</name> <value><string>foo & bar company</string></value> </member> </struct></value> </param> </params> </methodCall>
 [2010-05-05 15:34 UTC] varmando (Kai Palomäki)
It seems that bug report form doesn't allow literal entities...so let's try for third time with extra spaces around entities: Expected result: ---------------- ... <member><name>foo& amp ;bar</name> <value><string>foo & amp ; bar company</string></value> ... Actual result: -------------- ... <member><name>foo&bar</name> <value><string>foo & amp ; bar company</string></value> ...
 [2010-05-06 03:58 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Thanks for the patch, Kai! There's a few other places which look like this could occur; but I've left them alone - if you come across any more problems; let us know. Out of curiosity, XML_RPC2 is out - is there any reason you haven't migrated?
 [2010-05-06 18:01 UTC] varmando (Kai Palomäki)
Thanks Daniel! We have few old in-house applications that are using old XML_RPC. Translated to English this means that I am just being lazy :)
 [2010-07-03 22:21 UTC] danielc (Daniel Convissor)
Version 1.5.4 of this package has just been released and it includes this fix.