Specify the encoding in IXR_Server::output(). Props solarissmoke, sergey.s.betke@novgaro.ru, SergeyBiryukov. fixes #4794

git-svn-id: https://develop.svn.wordpress.org/trunk@21531 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-08-15 20:12:00 +00:00
parent 36a3924822
commit 128e63d9aa
1 changed files with 9 additions and 2 deletions

View File

@ -466,11 +466,18 @@ EOD;
function output($xml)
{
$xml = '<?xml version="1.0"?>'."\n".$xml;
$charset = function_exists('get_option') ? get_option('blog_charset') : '';
if ($charset)
$xml = '<?xml version="1.0" encoding="'.$charset.'"?>'."\n".$xml;
else
$xml = '<?xml version="1.0"?>'."\n".$xml;
$length = strlen($xml);
header('Connection: close');
header('Content-Length: '.$length);
header('Content-Type: text/xml');
if ($charset)
header('Content-Type: text/xml; charset='.$charset);
else
header('Content-Type: text/xml');
header('Date: '.date('r'));
echo $xml;
exit;