summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-04-01 19:07:54 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-04-01 19:12:09 +0200
commit601bd43a24f88f8f0e129743e7bc0b0d64eac887 (patch)
tree66d07e5a41bb6e2d5d07944dd14631a0f5f62e44 /application/controllers/file.php
parent60eb8a720372b918e680bb61d9dab05046716080 (diff)
file/do_websubmit: throw exception rather than assert
An assert is actually wrong for user input. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php5
1 files changed, 3 insertions, 2 deletions
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));