Make WordPress Core

Changeset 21531


Ignore:
Timestamp:
08/15/2012 08:12:00 PM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-IXR.php

    r19712 r21531  
    467467    function output($xml)
    468468    {
    469         $xml = '<?xml version="1.0"?>'."\n".$xml;
     469        $charset = function_exists('get_option') ? get_option('blog_charset') : '';
     470        if ($charset)
     471            $xml = '<?xml version="1.0" encoding="'.$charset.'"?>'."\n".$xml;
     472        else
     473            $xml = '<?xml version="1.0"?>'."\n".$xml;
    470474        $length = strlen($xml);
    471475        header('Connection: close');
    472476        header('Content-Length: '.$length);
    473         header('Content-Type: text/xml');
     477        if ($charset)
     478            header('Content-Type: text/xml; charset='.$charset);
     479        else
     480            header('Content-Type: text/xml');
    474481        header('Date: '.date('r'));
    475482        echo $xml;
Note: See TracChangeset for help on using the changeset viewer.