Forums

XML-RPC does not work in debug mode (2 posts)

  1. Tgr
    Member
    Posted 2 years ago #

    xmlrpc.php breaks in debug mode because of the PHP warnings caused by loose variable handling. A typical output:

    <br />
    <b>Notice</b>:  Undefined index:  categories in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2463</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  mt_excerpt in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2473</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  mt_text_more in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2474</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  mt_keywords in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2496</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  mt_tb_ping_urls in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2509</b><br />
    <br />
    <b>Notice</b>:  Undefined index:  enclosure in <b>/var/www/konvtv/xmlrpc.php</b> on line <b>2550</b><br />
    <br />
    <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/konvtv/xmlrpc.php:2463) in <b>/var/www/konvtv/wp-includes/class-IXR.php</b> on line <b>395</b><br />

    Crappy PHP code that throws a lot of warnings is a general annoyance in debug mode, but with XML-RPC it is especially bad because it returns invalid XML, which will cause some other app to choke without showing for the developer, so it wastes a lot of time to find out what exactly went wrong.

    (Pasting the exact error message here for google-friendliness: xml.parsers.expat.ExpatError: junk after document element)

  2. Joseph Scott
    Member
    Posted 2 years ago #

    Agreed. Patches can be submitted via tickets at http://core.trac.wordpress.org/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags