mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
2e2223ae74
commit
1fd0dcbc9e
@ -366,6 +366,13 @@ class WP {
|
|||||||
} elseif ( empty( $this->query_vars['feed'] ) ) {
|
} elseif ( empty( $this->query_vars['feed'] ) ) {
|
||||||
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
|
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
|
||||||
} else {
|
} 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
|
// We're showing a feed, so WP is indeed the only thing that last changed
|
||||||
if ( !empty($this->query_vars['withcomments'])
|
if ( !empty($this->query_vars['withcomments'])
|
||||||
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user