Changeset 38929 for trunk/src/wp-includes/functions.php
- Timestamp:
- 10/25/2016 09:53:22 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r38928 r38929 1213 1213 function do_feed() { 1214 1214 global $wp_query; 1215 1216 // Determine if we are looking at the main comment feed 1217 $is_main_comments_feed = ( $wp_query->is_comment_feed() && ! $wp_query->is_singular() ); 1218 1219 /* 1220 * Check the queried object for the existence of posts if it is not a feed for an archive, 1221 * search result, or main comments. By checking for the absense of posts we can prevent rendering the feed 1222 * templates at invalid endpoints. e.g.) /wp-content/plugins/feed/ 1223 */ 1224 if ( ! $wp_query->have_posts() && ! ( $wp_query->is_archive() || $wp_query->is_search() || $is_main_comments_feed ) ) { 1225 wp_die( __( 'ERROR: This is not a valid feed.' ), '', array( 'response' => 404 ) ); 1226 } 1215 1227 1216 1228 $feed = get_query_var( 'feed' );
Note: See TracChangeset
for help on using the changeset viewer.