mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-01 00:10:36 +01:00
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:
parent
6852b3d4ec
commit
bb5d95dd95
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
if (empty($feed)) {
|
if (empty($feed)) {
|
||||||
$blog = 1;
|
$blog = 1;
|
||||||
|
$feed = 'atom';
|
||||||
$doing_rss = 1;
|
$doing_rss = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
@ -101,10 +101,6 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '' != $feed )
|
|
||||||
$doing_rss = true;
|
|
||||||
|
|
||||||
|
|
||||||
if ( is_trackback() )
|
if ( is_trackback() )
|
||||||
$doing_trackback = true;
|
$doing_trackback = true;
|
||||||
|
|
||||||
@ -112,7 +108,7 @@ if ( is_trackback() )
|
|||||||
|
|
||||||
if ( is_404() ) {
|
if ( is_404() ) {
|
||||||
header('HTTP/1.x 404 Not Found');
|
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'));
|
@header('X-Pingback: '. get_bloginfo('pingback_url'));
|
||||||
} else {
|
} else {
|
||||||
// We're showing a feed, so WP is indeed the only thing that last changed
|
// 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
|
// If $wp_template_redirect is set to false, template redirection
|
||||||
// should be skipped for everything except feeds and trackbacks.
|
// should be skipped for everything except feeds and trackbacks.
|
||||||
$wp_template_redirect = true;
|
$wp_template_redirect = true;
|
||||||
if ( is_feed() ) {
|
if ( is_feed() && empty($doing_rss) ) {
|
||||||
include(ABSPATH . '/wp-feed.php');
|
include(ABSPATH . '/wp-feed.php');
|
||||||
exit;
|
exit;
|
||||||
} else if ( is_trackback() ) {
|
} else if ( is_trackback() ) {
|
||||||
@ -217,7 +213,7 @@ if ($pagenow == 'index.php') {
|
|||||||
} elseif ( !isset($wp_template_redirect) ) {
|
} elseif ( !isset($wp_template_redirect) ) {
|
||||||
$wp_template_redirect = true;
|
$wp_template_redirect = true;
|
||||||
do_action('template_redirect');
|
do_action('template_redirect');
|
||||||
if ( is_feed() ) {
|
if ( is_feed() && empty($doing_rss) ) {
|
||||||
include(ABSPATH . '/wp-feed.php');
|
include(ABSPATH . '/wp-feed.php');
|
||||||
exit;
|
exit;
|
||||||
} else if ( is_trackback() ) {
|
} else if ( is_trackback() ) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
if ( empty($feed) ) {
|
if ( empty($feed) ) {
|
||||||
|
$feed = 'rss2';
|
||||||
$withcomments = 1;
|
$withcomments = 1;
|
||||||
|
$doing_rss = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ if (empty($doing_rss)) {
|
|||||||
$feed = preg_replace('/^_+/', '', $feed);
|
$feed = preg_replace('/^_+/', '', $feed);
|
||||||
|
|
||||||
if ($feed == '' || $feed == 'feed') {
|
if ($feed == '' || $feed == 'feed') {
|
||||||
// TODO: Get default feed from options DB.
|
|
||||||
$feed = 'rss2';
|
$feed = 'rss2';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
if (empty($feed)) {
|
if (empty($feed)) {
|
||||||
$blog = 1; // enter your blog's ID
|
$blog = 1; // enter your blog's ID
|
||||||
|
$feed = 'rdf';
|
||||||
$doing_rss = 1;
|
$doing_rss = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
if (empty($feed)) {
|
if (empty($feed)) {
|
||||||
$blog = 1;
|
$blog = 1;
|
||||||
|
$feed = 'rss';
|
||||||
$doing_rss = 1;
|
$doing_rss = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
if (empty($feed)) {
|
if (empty($feed)) {
|
||||||
$blog = 1;
|
$blog = 1;
|
||||||
|
$feed = 'rss2';
|
||||||
$doing_rss = 1;
|
$doing_rss = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user