Wordpress 3.6-scripts
[autoinstalls/wordpress.git] / wp-includes / class-IXR.php
index 9d89f0c58d7497c4f08a6644d8cd36b3afcc3880..f8fbc00b10f67b8d154c4dc9a8e8d50bf8de229a 100644 (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;
@@ -1061,5 +1068,3 @@ class IXR_ClientMulticall extends IXR_Client
         return parent::query('system.multicall', $this->calls);
     }
 }
-
-?>