Remove legacy media.upload_limit references

This commit is contained in:
Andy Miller
2019-03-12 06:25:56 -06:00
parent 7d7418df26
commit 8718c5ef31
2 changed files with 3 additions and 7 deletions

View File

@@ -109,9 +109,8 @@ class Config extends Data
}
}
// Override the media.upload_limit based on PHP values
$upload_limit = Utils::getUploadLimit();
$this->items['system']['media']['upload_limit'] = $upload_limit > 0 ? $upload_limit : 1024*1024*1024;
// Legacy value - Override the media.upload_limit based on PHP values
$this->items['system']['media']['upload_limit'] = Utils::getUploadLimit();
}
/**

View File

@@ -107,10 +107,7 @@ trait FlexMediaTrait
throw new RuntimeException(sprintf($language->translate('PLUGIN_ADMIN.FILEUPLOAD_UNABLE_TO_UPLOAD'), $filename, 'Bad filename'), 400);
}
/** @var Config $config */
$config = $grav['config'];
$grav_limit = (int) $config->get('system.media.upload_limit', 0);
$grav_limit = Utils::getUploadLimit();
if ($grav_limit > 0 && $uploadedFile->getSize() > $grav_limit) {
throw new RuntimeException($language->translate('PLUGIN_ADMIN.EXCEEDED_GRAV_FILESIZE_LIMIT'), 400);
}