From 601bd43a24f88f8f0e129743e7bc0b0d64eac887 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 1 Apr 2015 19:07:54 +0200 Subject: file/do_websubmit: throw exception rather than assert An assert is actually wrong for user input. Signed-off-by: Florian Pritz --- application/controllers/file.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'application') diff --git a/application/controllers/file.php b/application/controllers/file.php index 5bfec4c44..4c9291b75 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -767,8 +767,9 @@ class File extends MY_Controller { $contents = $this->input->post("content"); $filenames = $this->input->post("filename"); - assert(is_array($filenames)); - assert(is_array($contents)); + if (!is_array($filenames) || !is_array($contents)) { + throw new \exceptions\UserInputException('file/websubmit/invalid-form', 'The submitted POST form is invalid'); + } $ids = array(); $ids = array_merge($ids, $this->_handle_textarea($contents, $filenames)); -- cgit v1.2.3-24-g4f1b