file size check using system.yaml

This commit is contained in:
Gert
2015-04-27 19:33:48 +02:00
parent 5a55e5a9b6
commit 96b10228a6

View File

@@ -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;
}