mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-20 14:33:10 +01:00
Handle empty files due to upload_max_filesize
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user