Fix #5017: File CLI Command fails due to manually deleted files (#5025)

This commit is contained in:
Lucas Bartholemy 2021-04-19 18:37:20 +02:00 committed by GitHub
parent 95233c1c19
commit e812f035a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ HumHub Changelog
- Fix #5002: Fix loading of fixture spaces on tests
- Fix #5018: Activity stream problems with many user accounts
- Fix #5013: XSendFile broken when no SERVER_NAME header provided
- Fix #5017: File CLI Command fails due to manually deleted files
1.8.1 (March 12, 2021)

View File

@ -32,6 +32,10 @@ class FileController extends \yii\console\Controller
$fileSizes = [];
/** @var File $file */
foreach (File::find()->each() as $file) {
if (!is_file($file->store->get())) {
continue;
}
$fileSize += filesize($file->store->get());
foreach ($file->store->getVariants() as $variant) {
if (!isset($fileSizes[$variant])) {