]> git.wh0rd.org Git - tt-rss.git/commitdiff
check_feed_favicon: only guess favicon url when local icon doesn't exist (closes...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 21 Sep 2011 04:41:22 +0000 (08:41 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 21 Sep 2011 04:41:22 +0000 (08:41 +0400)
functions.php

index 5ec459fa8ccb20f96b92755dc4a990eb2b3ea2c8..d8ee0a952cc970d78685adc7b081496f45354da1 100644 (file)
        } // 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);
+                                       }
                                }
                        }
                }