diff options
author | Andrew Dolgov <[email protected]> | 2022-12-02 07:34:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-12-02 07:34:51 +0300 |
commit | 824addbc9d3f7bb4c1c94c5b795f9c8ae3211870 (patch) | |
tree | 34a98047ed85571dbe93aabff63f1d7998d10645 /classes/rssutils.php | |
parent | 94c49399cc10c1f7001e8c76db7575b70e1fc674 (diff) |
fix cleanup_feed_icons unlinking nonexistant files, limit it to actual feed icons
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-x | classes/rssutils.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index 8b96371dc..9d9b335c6 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -44,7 +44,7 @@ class RSSUtils { if ($dh) { while (($icon = readdir($dh)) !== false) { - if ($cache->get_mtime($icon) < time() - 86400 * Config::get(Config::CACHE_MAX_DAYS)) { + if (preg_match('/^[0-9]{1,}$/', $icon) && $cache->get_mtime($icon) < time() - 86400 * Config::get(Config::CACHE_MAX_DAYS)) { $sth->execute([(int)$icon]); @@ -54,7 +54,7 @@ class RSSUtils { $icon_path = $cache->get_full_path($icon); Debug::log("Removing orphaned feed icon: $icon_path"); - unlink($icon); + unlink($icon_path); } } } |