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
This commit is contained in:
ksdhans 2016-06-14 17:38:43 +12:00 committed by GitHub
parent 073fca5f0d
commit 95e14e5496

View File

@ -1104,9 +1104,9 @@ class Blog_Controller extends Page_Controller
* *
* @return string * @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); $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" * 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'); $rss = $this->request->param('Rss');
if($rss && strcasecmp($rss, "rss") == 0) { if(is_string($rss) && strcasecmp($rss, "rss") == 0) {
return true; return true;
} else { } else {
return false; return false;