]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
check there is an array of notices to display, before doing a foreach()
authorBrenda Wallace <shiny@cpan.org>
Thu, 26 Nov 2009 05:54:52 +0000 (18:54 +1300)
committerBrenda Wallace <shiny@cpan.org>
Thu, 26 Nov 2009 05:54:52 +0000 (18:54 +1300)
lib/rssaction.php

index 3b303f73ea0540b8bb50989e7938ce50af03048e..d591c99ed8e86684b98c0fb9400808ed01f82ef0 100644 (file)
@@ -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');