From 1fd0dcbc9eeaa857f64005d42f54114a525792ac Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 20 Aug 2015 06:10:24 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp.php | 7 +++++++ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index b5d9f91c24..69a45ada48 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -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-' ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 394cd46cf1..bd6ef93bc6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.