﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
12089,Unintended blank lines in plugins break XML for feeds,bchecketts,MarkJaquith,"A plugin or theme file may unintentionally output blank lines.  When displaying an RSS feed, this breaks XML validation of the page.

To recreate, simply create and activate a plugin that has an extra blank line after the closing ?> characters in the file.

Google Chrome displays this error.  Other browsers display something similar:
{{{
error on line 4 at column 6: XML declaration allowed only at the start of the document
}}}

Although technically a problem with the plugin, Wordpress can easily be modified to discard the undesired output by calling ob_clean() prior to outputting the XML.  It seems that ob_start() is already called earlier, so ob_clean() discards any output since that call.

For example, in the default configuration, you can add this line in wp-includes/feed-rss2.php just above the header() function call (in about line 7)

ob_clean();

The top of wp-includes/feed-rss2.php now looks like this:
{{{
<?php
/**
 * RSS2 Feed Template for displaying RSS2 Posts feed.
 *
 * @package WordPress
 */

ob_clean();
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
}}}

",defect (bug),closed,normal,3.0,Plugins,,normal,fixed,has-patch tested dev-feedback,
