summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-11-24 23:43:46 +0300
committerAndrew Dolgov <[email protected]>2022-11-24 23:43:46 +0300
commit3212c51ce89db215a1c743897aed80c8fcc41ed3 (patch)
treec540895c19aee9a1b8a051bca4e224c5f5905a12 /classes
parenta30b9bb649d6e10a5d7c2feb73376669cf23ef68 (diff)
migrate favicons directly to new cache
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/rssutils.php7
1 files changed, 4 insertions, 3 deletions
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);
}
}
}