aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-10-13 19:23:46 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-13 19:23:46 +0100
commitfbe159d78ce133cadf79645660f49ddf7bfbc569 (patch)
tree092cd7bbd7b39f141560e0c13580d157cb27f7df /perllib/FixMyStreet/App.pm
parent8ab9812e6cd5f686f7ab4d9a9859e8be4456ccd0 (diff)
parenta5ef113e2cc3105da41cf5449b505db6fa336c59 (diff)
Merge branch 'issues/forcouncils/95-multi-select-list-filters'
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r--perllib/FixMyStreet/App.pm10
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