WordPress.org

Make WordPress Core

Ticket #4794: 4794.diff

File 4794.diff, 728 bytes (added by solarissmoke, 8 years ago)

Set charset/encoding in XML response - same as we do everywhere else in core

  • wp-includes/class-IXR.php

     
    466466
    467467    function output($xml)
    468468    {
    469         $xml = '<?xml version="1.0"?>'."\n".$xml;
     469        $charset = get_option('blog_charset');
     470                $xml = '<?xml version="1.0" encoding="' . $charset . '"?>'."\n".$xml;
    470471        $length = strlen($xml);
    471472        header('Connection: close');
    472473        header('Content-Length: '.$length);
    473         header('Content-Type: text/xml');
     474        header('Content-Type: text/xml' . '; charset=' . $charset);
    474475        header('Date: '.date('r'));
    475476        echo $xml;
    476477        exit;