Skip to content

Commit

Permalink
fix where RSS feed only has a single item
Browse files Browse the repository at this point in the history
  • Loading branch information
petecoop committed Sep 10, 2015
1 parent 0d0c4a3 commit 70f4395
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Vinelab/Rss/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ public function setArticles($channel)
{
$this->articles = new ArticlesCollection();

foreach ($channel['item'] as $entry) {
$this->addArticle($entry);
if(is_array($channel['item'])){
foreach ($channel['item'] as $entry) {
$this->addArticle($entry);
}
}else{
$this->addArticle($channel['item']);
}
}

Expand Down

0 comments on commit 70f4395

Please sign in to comment.