diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-30 15:38:58 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-30 15:38:58 -0400 |
commit | eda7f50864cd4e92b8541065e6ec0fa1f7d990ec (patch) | |
tree | e272b45e29ffa8cff434234e96b7cfcd41fcc34a /lib/utils.php | |
parent | 25051024bc3609ead82bddee50ddf129f6aa535f (diff) |
fixes what broke in the last commit
Diffstat (limited to 'lib/utils.php')
-rw-r--r-- | lib/utils.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/utils.php b/lib/utils.php index 12a9506ec..cc3b6aa09 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -30,21 +30,20 @@ class OC_News_Utils { return null; } - if (!$spfeed->handle_content_type()) { - return null; - } + $spfeed->handle_content_type(); $title = $spfeed->get_title(); - - $spitems = $spfeed->get_items(); + $items = array(); - foreach($spitems as $spitem) { //FIXME: maybe we can avoid this loop - $itemUrl = $spitem->get_permalink(); - $itemTitle = $spitem->get_title(); - $itemGUID = $spitem->get_id(); - $itemBody = $spitem->get_content(); - $items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody); + if ($spitems = $spfeed->get_items()) { + foreach($spitems as $spitem) { //FIXME: maybe we can avoid this loop + $itemUrl = $spitem->get_permalink(); + $itemTitle = $spitem->get_title(); + $itemGUID = $spitem->get_id(); + $itemBody = $spitem->get_content(); + $items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody); + } } - + $feed = new OC_News_Feed($url, $title, $items); $favicon = $spfeed->get_image_url(); |