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

git-svn-id: http://core.svn.wordpress.org/trunk@21531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-08-15 20:12:00 +00:00
parent b104249ef2
commit cb64a77217

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;