WordPress.org

Make WordPress Core

Ticket #4794: class-IXR.php

File class-IXR.php, 739 bytes (added by sergey.s.betke@…, 2 years ago)

patch for resolving XMLRPC encoding error

Line 
1Index: class-IXR.php
2===================================================================
3--- class-IXR.php       (revision 19547)
4+++ class-IXR.php       (working copy)
5@@ -466,12 +466,12 @@
6 
7     function output($xml)
8     {
9-        $xml = '<?xml version="1.0"?>'."\n".$xml;
10+        $xml = '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'."\n".$xml;
11         $length = strlen($xml);
12         header('Connection: close');
13         header('Content-Length: '.$length);
14-        header('Content-Type: text/xml');
15-        header('Date: '.date('r'));
16+        header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
17+        header('Date: '.date(DATE_RFC1123));
18         echo $xml;
19         exit;
20     }