From f4dd5298d42f2d3dc0e03c6116734e2d90b63cf2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 22 Aug 2013 17:18:52 +0200 Subject: 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 --- application/controllers/file.php | 5 +++++ 1 file changed, 5 insertions(+) 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"]); -- cgit v1.2.3-24-g4f1b