diff options
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 40a99b6d3..ab5e62233 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -447,11 +447,13 @@ a list, with an empty list if no parameter is present. =cut sub get_param_list { - my ($c, $param) = @_; + my ($c, $param, $allow_commas) = @_; + die unless wantarray; my $value = $c->req->params->{$param}; - return @$value if ref $value; - return ($value) if defined $value; - return (); + return () unless defined $value; + my @value = ref $value ? @$value : ($value); + return map { split /,/, $_ } @value if $allow_commas; + return @value; } =head2 set_param |