From 934deae450acc38ee7909e3b2efa3acb79369786 Mon Sep 17 00:00:00 2001 From: isaak Date: Mon, 31 Oct 2011 12:18:31 +0100 Subject: [PATCH] checking if population id is an all digit argument for relevant forms --- lib/SGN/Controller/Qtl.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/SGN/Controller/Qtl.pm b/lib/SGN/Controller/Qtl.pm index a0d4172a3..c04e30255 100644 --- a/lib/SGN/Controller/Qtl.pm +++ b/lib/SGN/Controller/Qtl.pm @@ -501,6 +501,14 @@ sub qtl_form : PathPart('qtl/form') Chained Args { $c->throw_404("Population id argument is missing"); } + if ($pop_id and $pop_id !~ /^([0-9]+)$/) + { + $c->throw_404("$pop_id is not an accepted argument. + This form expects an all digit population id, instead of + $pop_id" + ); + } + $c->stash( template => $self->get_template($c, $type), pop_id => $pop_id, guide => $self->guideline, -- 2.11.4.GIT