WordPress.org

Make WordPress Core

Ticket #46813: 46813.diff

File 46813.diff, 1.0 KB (added by tmdesigned, 18 months ago)

Check for $wp_query before trying is_feed, is_comment_feed, and is_trackback

  • functions.php

     
    29642964 */
    29652965function wp_die( $message = '', $title = '', $args = array() ) {
    29662966
     2967        global $wp_query;
     2968
    29672969        if ( is_int( $args ) ) {
    29682970                $args = array( 'response' => $args );
    29692971        } elseif ( is_int( $title ) ) {
     
    30083010                 */
    30093011                $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
    30103012        } elseif ( wp_is_xml_request()
    3011                 || function_exists( 'is_feed' ) && is_feed()
    3012                 || function_exists( 'is_comment_feed' ) && is_comment_feed()
    3013                 || function_exists( 'is_trackback' ) && is_trackback() ) {
     3013                || isset( $wp_query ) && function_exists( 'is_feed' ) && is_feed()
     3014                || isset( $wp_query ) && function_exists( 'is_comment_feed' ) && is_comment_feed()
     3015                || isset( $wp_query ) && function_exists( 'is_trackback' ) && is_trackback() ) {
    30143016                /**
    30153017                 * Filters the callback for killing WordPress execution for XML requests.
    30163018                 *