diff options
author | Brenda Wallace <shiny@cpan.org> | 2009-11-26 18:54:52 +1300 |
---|---|---|
committer | Brenda Wallace <shiny@cpan.org> | 2009-11-26 18:54:52 +1300 |
commit | c3110ec8ace2ee6b9fdb3c0995c9ad465ba00a14 (patch) | |
tree | cb89f0598d6bbf49d53b2582049d8809af51aaf2 /lib | |
parent | 2d25f288a7bebedd6c2eaf08081bccdbc9107d36 (diff) |
check there is an array of notices to display, before doing a foreach()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rssaction.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php index 3b303f73e..d591c99ed 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'); |