expire_cached_files: check for glob() returning false
This commit is contained in:
parent
7439bda4b2
commit
2ab20c313c
1 changed files with 6 additions and 5 deletions
|
@ -1369,6 +1369,7 @@
|
||||||
if (is_writable($cache_dir)) {
|
if (is_writable($cache_dir)) {
|
||||||
$files = glob("$cache_dir/*");
|
$files = glob("$cache_dir/*");
|
||||||
|
|
||||||
|
if ($files)
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if (time() - filemtime($file) > 86400*7) {
|
if (time() - filemtime($file) > 86400*7) {
|
||||||
unlink($file);
|
unlink($file);
|
||||||
|
|
Loading…
Reference in a new issue