File settings max size fix (#7240)

* File Settings size fix

* File Settings size fix
This commit is contained in:
Gevorg Mansuryan 2024-10-02 11:11:15 +04:00 committed by GitHub
parent 73d2816840
commit 366823d3b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -41,6 +41,7 @@ HumHub Changelog
- Enh #7233: Mobile view: enlarge images in gallery preview of entries for the wall stream - Enh #7233: Mobile view: enlarge images in gallery preview of entries for the wall stream
- Enh #7237: Changed PoweredBy URL - Enh #7237: Changed PoweredBy URL
- Enh #7238: Fixed PHP warning related to `.env` - Enh #7238: Fixed PHP warning related to `.env`
- Enh #7240: Fixed maximum file size setting in initialization
1.16.3 (Unreleased) 1.16.3 (Unreleased)
-------------------------- --------------------------

View File

@ -88,10 +88,12 @@ class FileSettingsForm extends Model
$fileSizeKey = 'post_max_size'; $fileSizeKey = 'post_max_size';
} }
$maxUploadSizeInMb = $maxUploadSize / 1024 / 1024;
return [ return [
$fileSizeKey, $fileSizeKey,
floor($maxUploadSize / 1024 / 1024), $maxUploadSizeInMb,
min($maxUploadSize, 64), min($maxUploadSizeInMb, 64),
]; ];
} }

View File

@ -60,7 +60,7 @@ class InitialData
// File // File
[,,$defaultMaxUploadSize] = FileSettingsForm::getPHPMaxUploadSize(); [,,$defaultMaxUploadSize] = FileSettingsForm::getPHPMaxUploadSize();
Yii::$app->getModule('file')->settings->set('maxFileSize', $defaultMaxUploadSize); Yii::$app->getModule('file')->settings->set('maxFileSize', $defaultMaxUploadSize * 1024 * 1024);
Yii::$app->getModule('file')->settings->set('excludeMediaFilesPreview', '1'); Yii::$app->getModule('file')->settings->set('excludeMediaFilesPreview', '1');
// Caching // Caching