From df391ca93099e17f15875366dce37cacc9079f42 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 7 Dec 2010 16:50:15 +0100 Subject: remove old files when viewing; catch non existent files Signed-off-by: Florian Pritz --- system/application/controllers/file.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'system/application/controllers') diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php index 0ed66b511..a8ab406f7 100644 --- a/system/application/controllers/file.php +++ b/system/application/controllers/file.php @@ -35,14 +35,17 @@ class File extends Controller { // Try to guess what the user would like to do. // File uploads should be checked first because they are usually big and // take quite some time to upload. + $id = $this->uri->segment(1); if(isset($_FILES['file'])) { $this->do_upload(); } elseif ($this->input->post('content')) { $this->do_paste(); - } elseif ($this->file_mod->id_exists($this->uri->segment(1))) { + } elseif ($this->file_mod->id_exists($id)) { $this->file_mod->download(); } elseif ($this->var->cli_client) { die("No upload or unknown ID requested.\n"); + } elseif ($id != "file") { + $this->file_mod->non_existant(); } else { $this->upload_form(); } -- cgit v1.2.3-24-g4f1b