[wp-trac] [WordPress Trac] #2567: XML-RPC returns incorrect content length header when using metaWeblog.getRecentPosts
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 21 19:09:13 UTC 2012
#2567: XML-RPC returns incorrect content length header when using
metaWeblog.getRecentPosts
-------------------------------------------+------------------------------
Reporter: dasher@… | Owner: anonymous
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: XML-RPC | Version: 1.5
Severity: major | Resolution: wontfix
Keywords: xml-rpc |
-------------------------------------------+------------------------------
Changes (by wonderboymusic):
* status: reopened => closed
* resolution: => wontfix
Comment:
This shouldn't be fixed in {{{class-IXR.php}}} - you should fix it by
subclassing {{{wp_xmlrpc_server}}} which extends {{{IXR_Server}}}:
{{{
include_once( ABSPATH . WPINC . '/class-IXR.php' );
include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' );
add_filter( 'wp_xmlrpc_server_class', function () {
return 'eMusic_XMLRPC_Server';
} );
class eMusic_XMLRPC_Server extends wp_xmlrpc_server {
function __construct() {
parent::__construct();
}
function output( $xml ) {
$xml = '<?xml version="1.0"?>' . PHP_EOL . $xml;
header( 'Connection: close' );
header( 'Content-Type: text/xml' );
header( 'Date: ' . date( 'r' ) );
echo $xml;
exit();
}
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/2567#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list