Make sure is_feed() is true when feed files are referenced directly. http://mosquito.wordpress.org/view.php?id=726

git-svn-id: http://svn.automattic.com/wordpress/trunk@2272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2005-02-11 06:42:07 +00:00
parent 6852b3d4ec
commit bb5d95dd95
7 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@
if (empty($feed)) {
$blog = 1;
$feed = 'atom';
$doing_rss = 1;
require('wp-blog-header.php');
}

View File

@ -101,10 +101,6 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
}
}
if ( '' != $feed )
$doing_rss = true;
if ( is_trackback() )
$doing_trackback = true;
@ -112,7 +108,7 @@ if ( is_trackback() )
if ( is_404() ) {
header('HTTP/1.x 404 Not Found');
} else if ( !isset($doing_rss) || !$doing_rss ) {
} else if ( !is_feed() ) {
@header('X-Pingback: '. get_bloginfo('pingback_url'));
} else {
// We're showing a feed, so WP is indeed the only thing that last changed
@ -207,7 +203,7 @@ if ($pagenow == 'index.php') {
// If $wp_template_redirect is set to false, template redirection
// should be skipped for everything except feeds and trackbacks.
$wp_template_redirect = true;
if ( is_feed() ) {
if ( is_feed() && empty($doing_rss) ) {
include(ABSPATH . '/wp-feed.php');
exit;
} else if ( is_trackback() ) {
@ -217,7 +213,7 @@ if ($pagenow == 'index.php') {
} elseif ( !isset($wp_template_redirect) ) {
$wp_template_redirect = true;
do_action('template_redirect');
if ( is_feed() ) {
if ( is_feed() && empty($doing_rss) ) {
include(ABSPATH . '/wp-feed.php');
exit;
} else if ( is_trackback() ) {

View File

@ -1,6 +1,8 @@
<?php
if ( empty($feed) ) {
$feed = 'rss2';
$withcomments = 1;
$doing_rss = 1;
require('wp-blog-header.php');
}

View File

@ -9,7 +9,6 @@ if (empty($doing_rss)) {
$feed = preg_replace('/^_+/', '', $feed);
if ($feed == '' || $feed == 'feed') {
// TODO: Get default feed from options DB.
$feed = 'rss2';
}

View File

@ -2,6 +2,7 @@
if (empty($feed)) {
$blog = 1; // enter your blog's ID
$feed = 'rdf';
$doing_rss = 1;
require('wp-blog-header.php');
}

View File

@ -2,6 +2,7 @@
if (empty($feed)) {
$blog = 1;
$feed = 'rss';
$doing_rss = 1;
require('wp-blog-header.php');
}

View File

@ -2,6 +2,7 @@
if (empty($feed)) {
$blog = 1;
$feed = 'rss2';
$doing_rss = 1;
require('wp-blog-header.php');
}