make sure directory is given

This commit is contained in:
Steffen Schröder 2014-08-05 01:59:53 +02:00
parent 965fa3a499
commit 89987cd8f5

View File

@ -151,7 +151,7 @@ abstract class FileUtil {
* @return bool
*/
public static function cleanDirectory($directory, $maxFileAgeInDays = 10., $recursive = false) {
if (!is_dir($directory) || !is_readable($directory)) {
if (!$directory || !is_dir($directory) || !is_readable($directory)) {
return false;
}
$dirHandle = opendir($directory);