Skip to content

Commit

Permalink
Merge pull request #8 from petecoop/master
Browse files Browse the repository at this point in the history
fix where RSS feed only has a single item
  • Loading branch information
Mulkave committed Oct 14, 2015
2 parents 0d0c4a3 + 70f4395 commit 87ce95c
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 87ce95c

Please sign in to comment.