aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Location.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-08-09 10:42:15 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-08-09 10:42:15 +0100
commitef421c31febe5219042468e3ec33654cf1e11556 (patch)
treeba2cb86e67eddaa3e6b0da58743c0508eb855b63 /perllib/FixMyStreet/App/Controller/Location.pm
parent6ab7f377e14bbf83747d434241b1f1c0a26daf80 (diff)
Store lat/lon from multiple results and use that to prevent infinite loop on e.g. 'Clapham'.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Location.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Location.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm
index 9f8260768..df8a090c2 100644
--- a/perllib/FixMyStreet/App/Controller/Location.pm
+++ b/perllib/FixMyStreet/App/Controller/Location.pm
@@ -76,12 +76,12 @@ sub determine_location_from_pc : Private {
# $error doubles up to return multiple choices by being an array
if ( ref($error) eq 'ARRAY' ) {
- @$error = map {
- decode_utf8($_);
- s/, United Kingdom//;
- s/, UK//;
- $_;
- } @$error;
+ foreach (@$error) {
+ my $a = decode_utf8($_->{address});
+ $a =~ s/, United Kingdom//;
+ $a =~ s/, UK//;
+ $_->{address} = $a;
+ }
$c->stash->{possible_location_matches} = $error;
return;
}