Handle empty files due to upload_max_filesize

This commit is contained in:
Andy Miller
2019-03-12 18:29:13 -06:00
parent 030e4ae073
commit 33ac06bc2c
3 changed files with 12 additions and 1 deletions

View File

@@ -1567,6 +1567,15 @@ class AdminController extends AdminBaseController
/** @var Config $config */
$config = $this->grav['config'];
if (!isset($_FILES) || empty($_FILES)) {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin::translate('PLUGIN_ADMIN.EXCEEDED_POSTMAX_LIMIT')
];
return false;
}
if (!isset($_FILES['file']['error']) || is_array($_FILES['file']['error'])) {
$this->admin->json_response = [
'status' => 'error',