Make WordPress Core

Changeset 33658


Ignore:
Timestamp:
08/20/2015 06:09:28 AM (9 years ago)
Author:
wonderboymusic
Message:

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

Props stevenkword.
Fixes #32024.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r32708 r33658  
    367367            $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
    368368        } else {
     369            // Set the correct content type for feeds
     370            $type = $this->query_vars['feed'];
     371            if ( 'feed' == $this->query_vars['feed'] ) {
     372                $type = get_default_feed();
     373            }
     374            $headers['Content-Type'] = feed_content_type( $type ) . '; charset=' . get_option( 'blog_charset' );
     375
    369376            // We're showing a feed, so WP is indeed the only thing that last changed
    370377            if ( !empty($this->query_vars['withcomments'])
Note: See TracChangeset for help on using the changeset viewer.