Ensure that feeds are served with the proper `Content-Type` HTTP header.

Props stevenkword.
Fixes #32024.

Built from https://develop.svn.wordpress.org/trunk@33658


git-svn-id: http://core.svn.wordpress.org/trunk@33625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-20 06:10:24 +00:00
parent 2e2223ae74
commit 1fd0dcbc9e
2 changed files with 8 additions and 1 deletions

View File

@ -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-' )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33657';
$wp_version = '4.4-alpha-33658';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.