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
1 changed files with 5 additions and 4 deletions

View File

@ -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;