WordPress.org

Make WordPress Core

Ticket #39066: 39066.2.diff

File 39066.2.diff, 746 bytes (added by mboynes, 3 years ago)

Update patch to also check ajax and xmlrpc requests

  • src/wp-includes/feed.php

     
    702702        do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
    703703        $feed->init();
    704704        $feed->set_output_encoding( get_option( 'blog_charset' ) );
    705         $feed->handle_content_type();
    706705
     706        // Don't change response headers if this is a REST, Ajax, or XMLRPC request.
     707        if (
     708                ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST )
     709                && ( ! defined( 'XMLRPC_REQUEST' ) || ! XMLRPC_REQUEST )
     710                && ! wp_doing_ajax()
     711        ) {
     712                $feed->handle_content_type();
     713        }
     714
    707715        if ( $feed->error() )
    708716                return new WP_Error( 'simplepie-error', $feed->error() );
    709717