From 3212c51ce89db215a1c743897aed80c8fcc41ed3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 24 Nov 2022 23:43:46 +0300 Subject: migrate favicons directly to new cache --- classes/rssutils.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/rssutils.php b/classes/rssutils.php index a8c56295b..8b96371dc 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1695,15 +1695,16 @@ class RSSUtils { $dh = opendir($old_dir); + $cache = new DiskCache('feed-icons'); + if ($dh) { while (($old_filename = readdir($dh)) !== false) { if (strpos($old_filename, ".ico") !== false) { $new_filename = str_replace(".ico", "", $old_filename); $old_full_path = "$old_dir/$old_filename"; - $new_full_path = "$new_dir/$new_filename"; - if (is_file($old_full_path) && !file_exists($new_full_path)) { - rename($old_full_path, $new_full_path); + if (is_file($old_full_path) && $cache->put($new_filename, file_get_contents($old_full_path))) { + unlink($old_full_path); } } } -- cgit v1.2.3