From 95e14e54961e329c833a22f66f6dc8a721eeea01 Mon Sep 17 00:00:00 2001 From: ksdhans Date: Tue, 14 Jun 2016 17:38:43 +1200 Subject: [PATCH] Performed suggested changes - Removed hardcoded URL segment (was test code that I forgot to remove) - Changed if($rss to if(is_string($rss) - Moved bracket after isRSS() to next line - Made rssFeed() protected as it's an internal function and shouldn't be part of the public API --- code/model/Blog.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/model/Blog.php b/code/model/Blog.php index ced2017..a32f6d2 100644 --- a/code/model/Blog.php +++ b/code/model/Blog.php @@ -1104,9 +1104,9 @@ class Blog_Controller extends Page_Controller * * @return string */ - public function rssFeed($blogPosts) + protected function rssFeed($blogPosts) { - $rss = new RSSFeed($blogPosts, $this->Link() . 'category/general/', $this->MetaTitle, $this->MetaDescription); + $rss = new RSSFeed($blogPosts, $this->Link(), $this->MetaTitle, $this->MetaDescription); $this->extend('updateRss', $rss); @@ -1116,9 +1116,10 @@ class Blog_Controller extends Page_Controller /** * Returns true if the $Rss sub-action for categories/tags has been set to "rss" */ - private function isRSS() { + private function isRSS() + { $rss = $this->request->param('Rss'); - if($rss && strcasecmp($rss, "rss") == 0) { + if(is_string($rss) && strcasecmp($rss, "rss") == 0) { return true; } else { return false;