Merge pull request #1020 from NightJar/fix/5.7/maxfilesize

FIX correctly calculate MaxFileSizeMB
This commit is contained in:
Scott Hutchinson 2020-11-11 15:10:01 +13:00 committed by GitHub
commit 8dd6950218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,7 @@ class EditableFileField extends EditableFormField
$result = parent::validate();
$max = static::get_php_max_file_size();
if ($this->MaxFileSizeMB * 1024 > $max) {
if ($this->MaxFileSizeMB * 1024 * 1024 > $max) {
$result->addError("Your max file size limit can't be larger than the server's limit of {$this->getPHPMaxFileSizeMB()}.");
}