aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-10-03 10:38:23 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-03 10:56:20 +0100
commit233a0e5acb9af1ec5ae15c8211dc4da930d6b910 (patch)
tree3d8f4079df56d2e02525d69b874ee10490f22768 /perllib
parent52ab1010195bbd92152fb8a2635ca935241c319e (diff)
[UK] Fix ward pages containing ampersands.
Map ward names on their short names, so any processing applies equally to URL and names returned by MapIt.
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 005397fda..356578bb0 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -392,10 +392,11 @@ sub ward_check : Private {
my $qw = mySociety::MaPit::call('area/children', [ $parent_id ],
type => $c->cobrand->area_types_children,
);
- my %names = map { $_ => 1 } @wards;
+ my %names = map { $c->cobrand->short_name({ name => $_ }) => 1 } @wards;
my @areas;
foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) {
- push @areas, $area if $names{$area->{name}};
+ my $name = $c->cobrand->short_name($area);
+ push @areas, $area if $names{$name};
}
if (@areas) {
$c->stash->{ward} = $areas[0] if @areas == 1;