BUGFIX #6096 RSSFeed::feedContent() restores previous state of SSViewer::get_source_file_comments() after temporarily disabling it (thanks paradigmincarnate!)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111914 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-10-12 00:29:12 +00:00 committed by Sam Minnee
parent f410e092d4
commit 03f107ef35

View File

@ -193,11 +193,19 @@ class RSSFeed extends ViewableData {
}
/**
* Return the content of the RSS feed
* Return the content of the RSS feed.
*
* Also temporarily disabled source file comments, and restores
* to previous state once content has been rendered.
*
* @return string
*/
function feedContent() {
$prevState = SSViewer::get_source_file_comments();
SSViewer::set_source_file_comments(false);
return str_replace(' ', ' ', $this->renderWith('RSSFeed'));
$content = str_replace(' ', ' ', $this->renderWith('RSSFeed'));
SSViewer::set_source_file_comments($prevState);
return $content;
}
}