Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20705 closed defect (bug) (duplicate)

IXR_Server::output method doesn't honor blog_charset option

Reported by: aercolino's profile aercolino Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.2
Component: XML-RPC Keywords:
Focuses: Cc:

Description

I've been writing an enhancement for my LoginDongle plugin, where I will use a query string param to allow an XML-RPC user to log in.

To do that, I had to subclass the wp_xmlrpc_server class with a method like the following and add a filter for wp_xmlrpc_server_class.

public function output($xml)
{
    $format = get_option('blog_charset');
    $xml = '<?xml version="1.0" encoding="' . $format . '"?>'."\n".$xml;
    $length = strlen($xml);
    header('Connection: close');
    header('Content-Length: '.$length);
    header('Content-Type: text/xml; charset=' . $format);
    header('Date: '.date('r'));
    echo $xml;
    exit;
}

It would be nice to have that implemented in WP.

Change History (5)

#1 @aercolino
12 years ago

  • Cc cappuccino.e.cornetto@… added

#2 @aercolino
12 years ago

  • Component changed from General to XML-RPC

#3 @aercolino
12 years ago

Please note that on the other hand the little piece of xml that xmlrpc.php outputs when called with the rsd query string param, does just that, even if it's not really needed because the content is pure ASCII in that case.

#4 @markoheijnen
12 years ago

#4794 is the same issue.

#5 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.