]> git.wh0rd.org Git - tt-rss.git/commitdiff
getVirtCounters: check if plugin feeds exist
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Mar 2013 04:19:05 +0000 (08:19 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Mar 2013 04:19:05 +0000 (08:19 +0400)
include/functions.php

index f33de076b0d5878cac161fff2c77574ef4a32282..f2eeb976bc43e13f09bb133d8495f427f0ee7a73 100644 (file)
                if ($pluginhost) {
                        $feeds = $pluginhost->get_feeds(-1);
 
-                       foreach ($feeds as $feed) {
-                               $cv = array("id" => PluginHost::pfeed_to_feed_id($feed['id']),
-                                       "counter" => $feed['sender']->get_unread($feed['id']));
+                       if (is_array($feeds)) {
+                               foreach ($feeds as $feed) {
+                                       $cv = array("id" => PluginHost::pfeed_to_feed_id($feed['id']),
+                                               "counter" => $feed['sender']->get_unread($feed['id']));
 
-                               array_push($ret_arr, $cv);
+                                       array_push($ret_arr, $cv);
+                               }
                        }
-
                }
 
                return $ret_arr;