WordPress.org

Make WordPress Core

Ticket #30210: 30210.patch

File 30210.patch, 465 bytes (added by JRGould, 6 years ago)

Error if $wp_query doesn't contain any posts

  • src/wp-includes/functions.php

     
    11301130function do_feed() {
    11311131        global $wp_query;
    11321132
     1133        if ( ! $wp_query->have_posts() )
     1134                wp_die( __( 'ERROR: This is not a valid feed.' ), '', array( 'response' => 404 ) );
     1135
    11331136        $feed = get_query_var( 'feed' );
    11341137
    11351138        // Remove the pad, if present.