check there is an array of notices to display, before doing a foreach()

This commit is contained in:
Brenda Wallace 2009-11-26 18:54:52 +13:00
parent 2d25f288a7
commit c3110ec8ac

View File

@ -176,8 +176,10 @@ class Rss10Action extends Action
$this->showChannel(); $this->showChannel();
$this->showImage(); $this->showImage();
foreach ($this->notices as $n) { if (count($this->notices)) {
$this->showItem($n); foreach ($this->notices as $n) {
$this->showItem($n);
}
} }
$this->showCreators(); $this->showCreators();
@ -203,8 +205,10 @@ class Rss10Action extends Action
$this->elementStart('items'); $this->elementStart('items');
$this->elementStart('rdf:Seq'); $this->elementStart('rdf:Seq');
foreach ($this->notices as $notice) { if (count($this->notices)) {
$this->element('rdf:li', array('rdf:resource' => $notice->uri)); foreach ($this->notices as $notice) {
$this->element('rdf:li', array('rdf:resource' => $notice->uri));
}
} }
$this->elementEnd('rdf:Seq'); $this->elementEnd('rdf:Seq');