diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-30 14:08:36 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-30 14:08:36 -0400 |
commit | fd5b815e587ccc3642995346cd03eca4e0a0707f (patch) | |
tree | 2cc9bdf3de5e45b8f23e96673f4d8625651f81df /lib/utils.php | |
parent | a5438863a4e88fb5c9e166e8810f493a1feb2cf0 (diff) |
opml parser completed; still needs testing
Diffstat (limited to 'lib/utils.php')
-rw-r--r-- | lib/utils.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/utils.php b/lib/utils.php index 6735c3f60..12a9506ec 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -22,12 +22,17 @@ class OC_News_Utils { * @returns */ public static function fetch($url){ - //TODO: handle the case where fetching of the feed fails $spfeed = new SimplePie_Core(); $spfeed->set_feed_url( $url ); $spfeed->enable_cache( false ); - $spfeed->init(); - $spfeed->handle_content_type(); + + if (!$spfeed->init()) { + return null; + } + + if (!$spfeed->handle_content_type()) { + return null; + } $title = $spfeed->get_title(); $spitems = $spfeed->get_items(); @@ -53,6 +58,7 @@ class OC_News_Utils { $feed->setFavicon($webFavicon); } return $feed; + } public static function checkFavicon($favicon) { |