From 96b10228a642ca6071172eee7b0d627a9fc1f3f7 Mon Sep 17 00:00:00 2001 From: Gert Date: Mon, 27 Apr 2015 19:33:48 +0200 Subject: [PATCH] file size check using system.yaml --- classes/controller.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/controller.php b/classes/controller.php index 6b5010a2..5aa0b39e 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -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; }