From 4446c81177cf11894ffdd2b67634cb3c8e3fe052 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 26 Feb 2008 10:05:05 +0000 Subject: [PATCH] Return error when requesting invalid feed format. Props pishmishy. fixes #5446 git-svn-id: http://svn.automattic.com/wordpress/trunk@7038 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c2247eaa63..48f53f825b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -901,7 +901,12 @@ function do_feed() { $feed = get_default_feed(); $hook = 'do_feed_' . $feed; - do_action( $hook, $wp_query->is_comment_feed ); + if ( !has_action($hook) ) { + $message = sprintf( __( 'ERROR: %s is not a valid feed template' ), wp_specialchars($feed)); + wp_die($message); + } + + do_action( $hook, $wp_query->is_comment_feed ); }