FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17368&edit=1

ID: 17368
Comment by: vamos@netikka.fi
Reported By: vamos at netikka dot fi
Summary: struct member name serialization/encoding bug
Status: Open
Type: Bug
Package: XML_RPC
Operating System: Linux
Package Version: 1.5.3
PHP Version: 5.2.6
Roadmap Versions:
New Comment:

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>none</methodName>
<params>
<param>
<value><struct>
<member><name>foo&amp;bar</name>
<value><string>foo &amp; 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 &amp; bar company</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>


Previous Comments:
------------------------------------------------------------------------

[2010-05-05 11:22:22] varmando

Added #patch
bug:17368;patch:RPC-member-name-htmlentities.patch;revision:1273058542;.

------------------------------------------------------------------------

[2010-05-05 11:04:50] varmando

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>

------------------------------------------------------------------------

Search Discussions

  • Vamos at May 5, 2010 at 10:40 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17368&edit=1

    ID: 17368
    Comment by: vamos@netikka.fi
    Reported By: vamos at netikka dot fi
    Summary: struct member name serialization/encoding bug
    Status: Open
    Type: Bug
    Package: XML_RPC
    Operating System: Linux
    Package Version: 1.5.3
    PHP Version: 5.2.6
    Roadmap Versions:
    New Comment:

    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>
    ...


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-05-05 11:25:35] varmando

    Expected result:
    ----------------
    <?xml version="1.0" encoding="UTF-8"?>
    <methodCall>
    <methodName>none</methodName>
    <params>
    <param>
    <value><struct>
    <member><name>foo&amp;bar</name>
    <value><string>foo &amp; 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 &amp; bar company</string></value>
    </member>
    </struct></value>
    </param>
    </params>
    </methodCall>

    ------------------------------------------------------------------------

    [2010-05-05 11:22:22] varmando

    Added #patch
    bug:17368;patch:RPC-member-name-htmlentities.patch;revision:1273058542;.

    ------------------------------------------------------------------------

    [2010-05-05 11:04:50] varmando

    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>

    ------------------------------------------------------------------------
  • Daniel Oconnor at May 5, 2010 at 11:05 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=17368&edit=1

    ID: 17368
    Updated by: daniel.oconnor@gmail.com
    Reported By: vamos at netikka dot fi
    Summary: struct member name serialization/encoding bug
    -Status: Open
    +Status: Closed
    Type: Bug
    Package: XML_RPC
    Operating System: Linux
    Package Version: 1.5.3
    PHP Version: 5.2.6
    -Assigned To:
    +Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -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?


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-05-05 11:34:15] varmando

    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-05 11:25:35] varmando

    Expected result:
    ----------------
    <?xml version="1.0" encoding="UTF-8"?>
    <methodCall>
    <methodName>none</methodName>
    <params>
    <param>
    <value><struct>
    <member><name>foo&amp;bar</name>
    <value><string>foo &amp; 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 &amp; bar company</string></value>
    </member>
    </struct></value>
    </param>
    </params>
    </methodCall>

    ------------------------------------------------------------------------

    [2010-05-05 11:22:22] varmando

    Added #patch
    bug:17368;patch:RPC-member-name-htmlentities.patch;revision:1273058542;.

    ------------------------------------------------------------------------

    [2010-05-05 11:04:50] varmando

    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>

    ------------------------------------------------------------------------
  • Vamos at May 6, 2010 at 1:07 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=17368&edit=1

    ID: 17368
    Comment by: vamos@netikka.fi
    Reported By: vamos at netikka dot fi
    Summary: struct member name serialization/encoding bug
    Status: Closed
    Type: Bug
    Package: XML_RPC
    Operating System: Linux
    Package Version: 1.5.3
    PHP Version: 5.2.6
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    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 :)


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-05-05 23:58:54] doconnor

    -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-05 11:34:15] varmando

    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-05 11:25:35] varmando

    Expected result:
    ----------------
    <?xml version="1.0" encoding="UTF-8"?>
    <methodCall>
    <methodName>none</methodName>
    <params>
    <param>
    <value><struct>
    <member><name>foo&amp;bar</name>
    <value><string>foo &amp; 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 &amp; bar company</string></value>
    </member>
    </struct></value>
    </param>
    </params>
    </methodCall>

    ------------------------------------------------------------------------

    [2010-05-05 11:22:22] varmando

    Added #patch
    bug:17368;patch:RPC-member-name-htmlentities.patch;revision:1273058542;.

    ------------------------------------------------------------------------

    [2010-05-05 11:04:50] varmando

    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>

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 5, '10 at 10:31a
activeMay 6, '10 at 1:07p
posts4
users2
websitepear.php.net

2 users in discussion

Vamos: 3 posts Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase