summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-08-22 17:18:52 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-08-22 17:18:52 +0200
commitf4dd5298d42f2d3dc0e03c6116734e2d90b63cf2 (patch)
tree2447b127301b99ec5f72ea41e8b17b2d249b4dc5
parentbc5ca1351d7257905ef3bffc19966499689d988a (diff)
Validate IDs when generating thumbnail history
The thumbnail function generates an invalid image (HTML error message) if the ID is invalid resulting in empty images. Catch those when creating the page to prevent that. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/file.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 55ed10fea..d510badc0 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -416,6 +416,11 @@ class File extends CI_Controller {
", array($user))->result_array();
foreach($query as $key => $item) {
+ if (!$this->mfile->valid_id($item["id"])) {
+ unset($query[$key]);
+ continue;
+ }
+
$filesize = format_bytes($item["filesize"]);
$dimensions = $this->mfile->image_dimension($this->mfile->file($item["hash"]));
$upload_date = date("r", $item["date"]);