diff options
author | wn_ <[email protected]> | 2021-02-21 23:30:31 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2021-02-21 23:30:31 +0000 |
commit | 02a9485966dbbac1ed52ecbfb29fcc15125cba43 (patch) | |
tree | 4b5b49e3bea4cb3ad2a7e193833f2de1129573c6 /classes/rssutils.php | |
parent | cb401af6f6f278b94b664569796c49f045e3ffde (diff) |
Try to limit max favicon size, don't store current/old in a var.
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-x | classes/rssutils.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index 13f63bc7a..6785ab3f5 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1652,15 +1652,19 @@ class RSSUtils { } // Limiting to "image" type misses those served with text/plain - $contents = UrlHelper::fetch(['url' => $favicon_url]); // , "image"); + $contents = UrlHelper::fetch([ + 'url' => $favicon_url, + 'max_size' => MAX_FAVICON_FILE_SIZE, + //'type' => 'image', + ]); if (!$contents) { Debug::log("fetching favicon $favicon_url failed", Debug::$LOG_VERBOSE); return false; } - $original_contents = file_exists($icon_file) ? file_get_contents($icon_file) : null; - if ($original_contents) { - if (strcmp($contents, $original_contents) === 0) { + $original_contents_md5 = file_exists($icon_file) ? md5_file($icon_file) : null; + if ($original_contents_md5) { + if (md5($contents) == $original_contents_md5) { Debug::log("favicon content has not changed", Debug::$LOG_VERBOSE); return $icon_file; } |