From: Andrew Dolgov Date: Fri, 24 Feb 2012 09:43:50 +0000 (+0400) Subject: expire_cached_files: check for glob() returning false X-Git-Tag: 1.5.11~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2ab20c313c7fccf25f3603fc35158585ec911884;p=tt-rss.git expire_cached_files: check for glob() returning false --- diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 838087d9..6d3cfc3b 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -1369,14 +1369,15 @@ if (is_writable($cache_dir)) { $files = glob("$cache_dir/*"); - foreach ($files as $file) { - if (time() - filemtime($file) > 86400*7) { - unlink($file); + if ($files) + foreach ($files as $file) { + if (time() - filemtime($file) > 86400*7) { + unlink($file); - ++$num_deleted; + ++$num_deleted; + } } } - } if ($debug) _debug("Removed $num_deleted files."); }