summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-09-21 08:41:22 +0400
committerAndrew Dolgov <[email protected]>2011-09-21 08:41:22 +0400
commitc83a5aec38eca361fa459984f17fb4417d4f5a9a (patch)
tree31aa4f8c830dcbcdd6aa3b99a722b83405ec7e2e /functions.php
parentdea24b86b18c165dc2183241bff7e7ca670c7989 (diff)
check_feed_favicon: only guess favicon url when local icon doesn't exist (closes #369)
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/functions.php b/functions.php
index 5ec459fa8..d8ee0a952 100644
--- a/functions.php
+++ b/functions.php
@@ -465,21 +465,24 @@
} // function get_favicon_url
function check_feed_favicon($site_url, $feed, $link) {
- $favicon_url = get_favicon_url($site_url);
-
# print "FAVICON [$site_url]: $favicon_url\n";
$icon_file = ICONS_DIR . "/$feed.ico";
- if ($favicon_url && !file_exists($icon_file)) {
- $contents = fetch_file_contents($favicon_url, "image");
- if ($contents) {
- $fp = fopen($icon_file, "w");
+ if (!file_exists($icon_file)) {
+ $favicon_url = get_favicon_url($site_url);
- if ($fp) {
- fwrite($fp, $contents);
- fclose($fp);
- chmod($icon_file, 0644);
+ if ($favicon_url) {
+ $contents = fetch_file_contents($favicon_url, "image");
+
+ if ($contents) {
+ $fp = fopen($icon_file, "w");
+
+ if ($fp) {
+ fwrite($fp, $contents);
+ fclose($fp);
+ chmod($icon_file, 0644);
+ }
}
}
}