From 819b0abb8e76afadb2768d24f4eae645c8d4f2d3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 7 Jun 2016 11:44:03 +0200 Subject: mmultipaste->valid_id: Detect empty multipastes as invalid Signed-off-by: Florian Pritz --- application/models/mmultipaste.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/mmultipaste.php b/application/models/mmultipaste.php index 0185e8c7f..deb01978e 100644 --- a/application/models/mmultipaste.php +++ b/application/models/mmultipaste.php @@ -80,6 +80,10 @@ class Mmultipaste extends CI_Model { public function valid_id($id) { $files = $this->get_files($id); + if (count($files) === 0) { + return false; + } + foreach ($files as $file) { if (!$this->mfile->valid_id($file["id"])) { return false; -- cgit v1.2.3-24-g4f1b