diff --git a/bl-kernel/helpers/filesystem.class.php b/bl-kernel/helpers/filesystem.class.php index 9cc0261c..bbaecf6f 100644 --- a/bl-kernel/helpers/filesystem.class.php +++ b/bl-kernel/helpers/filesystem.class.php @@ -279,9 +279,11 @@ class Filesystem { if (file_exists($fileOrDirectory)) { $size = 0; foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fileOrDirectory, FilesystemIterator::SKIP_DOTS)) as $file){ - if (file_exists($file)) { - $size += $file->getSize(); - } + try { + $size += $file->getSize(); + } catch (Exception $e) { + // SplFileInfo::getSize RuntimeException will be thrown on broken symlinks/errors + } } return $size; }