summaryrefslogtreecommitdiffstats
path: root/system/application
diff options
context:
space:
mode:
Diffstat (limited to 'system/application')
-rw-r--r--system/application/models/file_mod.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php
index ec85ebb5a..83834f7f1 100644
--- a/system/application/models/file_mod.php
+++ b/system/application/models/file_mod.php
@@ -158,7 +158,7 @@ class File_mod extends Model {
$filedata = $this->get_filedata($id);
$file = $this->file($filedata['hash']);
- if ($this->id_exists($id) && file_exists($file)) {
+ if (file_exists($file)) {
$oldest_time = (time()-$this->config->item('upload_max_age'));
if (filesize($file) > $this->config->item("small_upload_size") && $filedata["date"] < $oldest_time) {
if (filemtime($file) < $oldest_time) {
@@ -273,10 +273,10 @@ class File_mod extends Model {
}
exit();
} else {
- // TODO: remove -controller function has been removed
- $this->load->view('file/header');
- $this->load->view('file/non_existant');
- $this->load->view('file/footer');
+ if (isset($filedata["hash"])) {
+ $this->db->query('DELETE FROM files WHERE hash = ?', array($filedata['hash']));
+ }
+ $this->non_existent();
}
}