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;
|
||||
}
|
||||
|
||||
$grav_limit = $config->get('system.media.upload_limit', 0);
|
||||
// You should also check filesize here.
|
||||
if ($_FILES['file']['size'] > 1000000) {
|
||||
$this->admin->json_response = ['error', 'Exceeded filesize limit.'];
|
||||
if ($grav_limit > 0 && $_FILES['file']['size'] > grav_limit) {
|
||||
$this->admin->json_response = ['error', 'Exceeded Grav filesize limit.'];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user