mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
file size check using system.yaml
This commit is contained in:
@@ -384,9 +384,10 @@ class AdminController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$grav_limit = $config->get('system.media.upload_limit', 0);
|
||||||
// You should also check filesize here.
|
// You should also check filesize here.
|
||||||
if ($_FILES['file']['size'] > 1000000) {
|
if ($grav_limit > 0 && $_FILES['file']['size'] > grav_limit) {
|
||||||
$this->admin->json_response = ['error', 'Exceeded filesize limit.'];
|
$this->admin->json_response = ['error', 'Exceeded Grav filesize limit.'];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user