From 4bd66b9d3693492806bb4e9a512f8ae623c6a306 Mon Sep 17 00:00:00 2001 From: Patrick Nelson Date: Fri, 22 Jan 2016 13:29:44 -0500 Subject: [PATCH] FIX for #4909: Ensure RSSFeed_Entry is instantiated using the injector. --- api/RSSFeed.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/RSSFeed.php b/api/RSSFeed.php index 22d6d704e..8aa774320 100644 --- a/api/RSSFeed.php +++ b/api/RSSFeed.php @@ -149,7 +149,7 @@ class RSSFeed extends ViewableData { if(isset($this->entries)) { foreach($this->entries as $entry) { $output->push( - new RSSFeed_Entry($entry, $this->titleField, $this->descriptionField, $this->authorField)); + RSSFeed_Entry::create($entry, $this->titleField, $this->descriptionField, $this->authorField)); } } return $output; @@ -184,7 +184,11 @@ class RSSFeed extends ViewableData { } /** - * Output the feed to the browser + * Output the feed to the browser. + * + * TODO: Pass $response object to ->outputToBrowser() to loosen dependence on global state for easier testing/prototyping so dev can inject custom SS_HTTPResponse instance. + * + * @return HTMLText */ public function outputToBrowser() { $prevState = Config::inst()->get('SSViewer', 'source_file_comments');