From 516072b12b38a789fe7847ef8dad5e48c271019d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 8 Apr 2012 23:54:50 +0200 Subject: do_upload(): fix errors if no file was uploaded Signed-off-by: Florian Pritz --- application/controllers/file.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index 2e8664984..c2838b795 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -232,7 +232,12 @@ class File extends CI_Controller { 4=>"No file was uploaded", 6=>"Missing a temporary folder" ); - $this->data["msg"] = $errors[$_FILES['file']['error']]; + + $this->data["msg"] = "Unknown error."; + + if (isset($_FILES["file"])) { + $this->data["msg"] = $errors[$_FILES['file']['error']]; + } $this->load->view($this->var->view_dir.'/header', $this->data); $this->load->view($this->var->view_dir.'/upload_error', $this->data); $this->load->view($this->var->view_dir.'/footer'); -- cgit v1.2.3-24-g4f1b