diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-18 13:48:43 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-18 16:03:10 +0100 |
commit | 14eab1f628ffb700ec7231f1f82aabbb2a4fbc5a (patch) | |
tree | aec772ddc39a52fd35c0914f50e3ef09d26966e8 | |
parent | 75a07fbfc7d2cd407189204a8e9a90d7fc3675cc (diff) |
Keep commas in geocode lookups.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2678c42..9796c7269 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Unreleased - Front end improvements: - Simplify footer CSS. #2107 + - Keep commas in geocode lookups. - Bugfixes: - Don't remove automated fields when editing contacts #2163 - Remove small border to left of Fixed banner. #2156 diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index aeac0ab6d..d552afaa5 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -59,7 +59,7 @@ sub string { sub escape { my ($s, $c) = @_; $s = lc($s); - $s =~ s/[^-&\w ']/ /g; + $s =~ s/[^-&\w ',]/ /g; $s =~ s/\s+/ /g; $s = URI::Escape::uri_escape_utf8($s); $s =~ s/%20/+/g; diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index 4d57007c5..0d296f299 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -30,7 +30,7 @@ sub string { $s = $params->{string} if $params->{string}; $s = FixMyStreet::Geocode::escape($s); - $s .= '+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; + $s .= '%2C+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; my $url = "${nominatimbase}search?"; my %query_params = ( |