From 128e63d9aa8d01377b75c238e25d56c9204dbb4f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 15 Aug 2012 20:12:00 +0000 Subject: [PATCH] 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 --- wp-includes/class-IXR.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 64a60d46b3..f8fbc00b10 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -466,11 +466,18 @@ EOD; function output($xml) { - $xml = ''."\n".$xml; + $charset = function_exists('get_option') ? get_option('blog_charset') : ''; + if ($charset) + $xml = ''."\n".$xml; + else + $xml = ''."\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;