From 824addbc9d3f7bb4c1c94c5b795f9c8ae3211870 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 2 Dec 2022 07:34:51 +0300 Subject: [PATCH] fix cleanup_feed_icons unlinking nonexistant files, limit it to actual feed icons --- classes/rssutils.php | 4 ++-- 1 file 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); } } }