Ensure that feeds are served with the proper Content-Type
HTTP header.
Props stevenkword. Fixes #32024. git-svn-id: https://develop.svn.wordpress.org/trunk@33658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
64944b7a87
commit
8528ff2ab4
@ -366,6 +366,13 @@ class WP {
|
||||
} elseif ( empty( $this->query_vars['feed'] ) ) {
|
||||
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
|
||||
} else {
|
||||
// Set the correct content type for feeds
|
||||
$type = $this->query_vars['feed'];
|
||||
if ( 'feed' == $this->query_vars['feed'] ) {
|
||||
$type = get_default_feed();
|
||||
}
|
||||
$headers['Content-Type'] = feed_content_type( $type ) . '; charset=' . get_option( 'blog_charset' );
|
||||
|
||||
// We're showing a feed, so WP is indeed the only thing that last changed
|
||||
if ( !empty($this->query_vars['withcomments'])
|
||||
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|
||||
|
Loading…
Reference in New Issue
Block a user