]> git.wh0rd.org Git - tt-rss.git/commitdiff
check file size when considering whether feed icon is valid (closes #223)
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 26 Oct 2008 16:53:46 +0000 (17:53 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 26 Oct 2008 16:53:46 +0000 (17:53 +0100)
functions.php

index f32d85af9dd354f36601b5672bc00bd036a078f1..89ec87a06d883fc64f6bb341a4300b0807964977 100644 (file)
 
                        $last_updated = htmlspecialchars($last_updated);
 
-                       $has_img = is_file(ICONS_DIR . "/$id.ico");
+                       $has_img = feed_has_icon($id);
 
                        $tmp_result = db_query($link,
                                "SELECT ttrss_feeds.id,COUNT(unread) AS unread
                                        $entry_author = " - $entry_author";
                                }
 
-                               $has_feed_icon = is_file(ICONS_DIR . "/$feed_id.ico");
+                               $has_feed_icon = feed_has_icon($feed_id);
 
                                if ($has_feed_icon) {
                                        $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
 
                                                        $vf_catchup_link = "(<a onclick='javascript:catchupFeedInGroup($feed_id);' href='#'>mark as read</a>)";
 
-                                                       $has_feed_icon = is_file(ICONS_DIR . "/$feed_id.ico");
+                                                       $has_feed_icon = feed_has_icon($feed_id);
 
                                                        if ($has_feed_icon) {
                                                                $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
                        onclick=\"return addLabelExample()\"
                        value=\"".__("Add")."\">";
        }
+
+       function feed_has_icon($id) {
+               return is_file(ICONS_DIR . "/$id.ico") && filesize(ICONS_DIR . "/$id.ico") > 0;
+       }
 ?>