summaryrefslogtreecommitdiffstats
path: root/system/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-12-07 17:09:10 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-12-07 17:09:10 +0100
commit92147fa2d0d3f5f223e5e7d7eddd4e5362b4407f (patch)
tree0618e7f8a0d7d626f02b5733d9bd6171e34ab50f /system/application
parent7d1cb9f52c3cdc0eb39a771309d785fc307dfc4f (diff)
remove all ids if the file doesn't exist
Signed-off-by: Florian Pritz <bluewind@xssn.at>
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();
}
}