Make WordPress Core

Ticket #22446: 22446-download-ajax.diff

File 22446-download-ajax.diff, 747 bytes (added by lessbloat, 12 years ago)
  • wp-includes/functions.php

     
    22732273 * @param mixed $response Variable (usually an array or object) to encode as JSON, then print and die.
    22742274 */
    22752275function wp_send_json( $response ) {
    2276         @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
     2276        if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false )
     2277                @header( 'Content-Type: text/html;' );
     2278        else
     2279                @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
     2280
    22772281        echo json_encode( $response );
    22782282        if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
    22792283                wp_die();