Show error 404 if the ID for experiment results is invalid

This commit is contained in:
Eike Foken
2011-09-20 21:45:28 +02:00
parent e13a67c56e
commit 11b3e4f109

View File

@@ -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']));