summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-23 22:33:23 +0400
committerAndrew Dolgov <[email protected]>2013-04-23 22:33:23 +0400
commit560cbd8c0dc1bdd7418c2e259d80c78281039769 (patch)
tree467b9d3be6912ab0335b63ed7f6971171a23647c /include
parent36490f11a3d7bf42e3725d4bb0884f3d0e49e4d8 (diff)
attempt to recalculate favicon avg color if it changes
Diffstat (limited to 'include')
-rw-r--r--include/rssfuncs.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 8bc5fcbd8..bc054ca52 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -417,15 +417,21 @@
if ($favicon_needs_check || $force_refetch) {
/* terrible hack: if we crash on floicon shit here, we won't check
- * the icon avgcolor again */
+ * the icon avgcolor again (unless the icon got updated) */
db_query("UPDATE ttrss_feeds SET favicon_avg_color = 'fail' WHERE
id = '$feed'");
+ $favicon_file = ICONS_DIR . "/$feed.ico";
+ $favicon_modified = @filemtime($favicon_file);
+
_debug("checking favicon...", $debug_enabled);
check_feed_favicon($site_url, $feed, $link);
- $favicon_file = ICONS_DIR . "/$feed.ico";
+ $favicon_modified_new = @filemtime($favicon_file);
+
+ if ($favicon_modified_new > $favicon_modified)
+ $favicon_avg_color = '';
if (file_exists($favicon_file) && function_exists("imagecreatefromstring") && $favicon_avg_color != 'fail') {
require_once "colors.php";