From 11b3e4f1093f45e20a6b7236a9fcb45a4f007ddc Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Tue, 20 Sep 2011 21:45:28 +0200 Subject: [PATCH] Show error 404 if the ID for experiment results is invalid --- application/controllers/results.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/results.php b/application/controllers/results.php index e25346a..297f943 100644 --- a/application/controllers/results.php +++ b/application/controllers/results.php @@ -59,9 +59,13 @@ class Results extends MY_Controller { * * @param string $experimentId The experiment for which to get the results */ - public function experiment($experimentId) { + public function experiment($experimentId = '') { $experiment = $this->experiment->getById($experimentId); + if (!is_array($experiment) || !isset($experiment['id'])) { + show_404(); + } + // execute program runner $program = $this->program->getById($experiment['program_id']); $this->load->library('program_runner', array('program_driver' => $program['driver']));