check_feed_favicon: only guess favicon url when local icon doesn't exist (closes #369)

This commit is contained in:
Andrew Dolgov 2011-09-21 08:41:22 +04:00
parent dea24b86b1
commit c83a5aec38
1 changed files with 13 additions and 10 deletions

View File

@ -465,14 +465,16 @@
} // function get_favicon_url } // function get_favicon_url
function check_feed_favicon($site_url, $feed, $link) { function check_feed_favicon($site_url, $feed, $link) {
$favicon_url = get_favicon_url($site_url);
# print "FAVICON [$site_url]: $favicon_url\n"; # print "FAVICON [$site_url]: $favicon_url\n";
$icon_file = ICONS_DIR . "/$feed.ico"; $icon_file = ICONS_DIR . "/$feed.ico";
if ($favicon_url && !file_exists($icon_file)) { if (!file_exists($icon_file)) {
$favicon_url = get_favicon_url($site_url);
if ($favicon_url) {
$contents = fetch_file_contents($favicon_url, "image"); $contents = fetch_file_contents($favicon_url, "image");
if ($contents) { if ($contents) {
$fp = fopen($icon_file, "w"); $fp = fopen($icon_file, "w");
@ -484,6 +486,7 @@
} }
} }
} }
}
function update_rss_feed($link, $feed, $ignore_daemon = false, $no_cache = false) { function update_rss_feed($link, $feed, $ignore_daemon = false, $no_cache = false) {