From: Brenda Wallace Date: Thu, 26 Nov 2009 05:54:52 +0000 (+1300) Subject: check there is an array of notices to display, before doing a foreach() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c3110ec8ace2ee6b9fdb3c0995c9ad465ba00a14;p=quix0rs-gnu-social.git check there is an array of notices to display, before doing a foreach() --- diff --git a/lib/rssaction.php b/lib/rssaction.php index 3b303f73ea..d591c99ed8 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -176,8 +176,10 @@ class Rss10Action extends Action $this->showChannel(); $this->showImage(); - foreach ($this->notices as $n) { - $this->showItem($n); + if (count($this->notices)) { + foreach ($this->notices as $n) { + $this->showItem($n); + } } $this->showCreators(); @@ -203,8 +205,10 @@ class Rss10Action extends Action $this->elementStart('items'); $this->elementStart('rdf:Seq'); - foreach ($this->notices as $notice) { - $this->element('rdf:li', array('rdf:resource' => $notice->uri)); + if (count($this->notices)) { + foreach ($this->notices as $notice) { + $this->element('rdf:li', array('rdf:resource' => $notice->uri)); + } } $this->elementEnd('rdf:Seq');