Make WordPress Core

Ticket #19448: 19448.2.diff

File 19448.2.diff, 916 bytes (added by SergeyBiryukov, 13 years ago)
  • wp-includes/class-wp-ajax-response.php

     
    126126         * @since 2.1.0
    127127         */
    128128        function send() {
    129                 header('Content-Type: text/xml');
    130                 echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";
     129                $xml = "<?xml version='1.0' encoding='" . get_option( 'blog_charset' ) . "' standalone='yes'?><wp_ajax>";
    131130                foreach ( (array) $this->responses as $response )
    132                         echo $response;
    133                 echo '</wp_ajax>';
     131                        $xml .= $response;
     132                $xml .= '</wp_ajax>';
     133
     134                status_header( 200 );
     135                nocache_headers();
     136                header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );
     137                header( 'Content-Length: ' . strlen( $xml ) );
     138                echo $xml;
     139
    134140                if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
    135141                        wp_die();
    136142                else