]> git.wh0rd.org - tt-rss.git/commitdiff
cache_media: only touch() local file if it's writable
authorAndrew Dolgov <noreply@fakecake.org>
Mon, 10 Sep 2018 13:17:12 +0000 (16:17 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Mon, 10 Sep 2018 13:17:12 +0000 (16:17 +0300)
classes/rssutils.php

index bffc41c6f1359df4cceee8d6dd40ca9f73be231a..094b294084f2b8509c70cbbc7199b692a84852cd 100755 (executable)
@@ -1218,7 +1218,7 @@ class RSSUtils {
                                        if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {
                                                file_put_contents($local_filename, $file_content);
                                        }
-                               } else {
+                               } else if (is_writable($local_filename)) {
                                        touch($local_filename);
                                }
                        }
@@ -1254,7 +1254,7 @@ class RSSUtils {
                                        if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {
                                                file_put_contents($local_filename, $file_content);
                                        }
-                               } else {
+                               } else if (is_writable($local_filename)) {
                                        touch($local_filename);
                                }
                        }