From 21450d4ab2e004570f3be1298f0595d6ff213047 Mon Sep 17 00:00:00 2001 From: Andy Rosslau Date: Fri, 29 Jun 2018 15:31:46 +0200 Subject: [PATCH] directories are skipped while garbage-collecting A typesafe check is neccessary, otherwise folders with the names "0" or "f" would be skipped as they would be interpreted as false in the while condition. http://php.net/manual/de/function.readdir.php --- GarbageCollect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GarbageCollect.php b/GarbageCollect.php index 548ddfc..d77698d 100644 --- a/GarbageCollect.php +++ b/GarbageCollect.php @@ -34,7 +34,7 @@ public static function dropOldFiles($directory, $days = 30, $verbose = false) return false; } - while ($file = readdir($dir)) { + while (false !== ($file = readdir($dir))) { if ($file == '.' || $file == '..') { continue; }