summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-12-02 07:34:51 +0300
committerAndrew Dolgov <[email protected]>2022-12-02 07:34:51 +0300
commit824addbc9d3f7bb4c1c94c5b795f9c8ae3211870 (patch)
tree34a98047ed85571dbe93aabff63f1d7998d10645
parent94c49399cc10c1f7001e8c76db7575b70e1fc674 (diff)
fix cleanup_feed_icons unlinking nonexistant files, limit it to actual feed icons
-rwxr-xr-xclasses/rssutils.php4
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);
}
}
}