diff options
author | Dave Arter <davea@mysociety.org> | 2018-03-21 12:42:50 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-10 10:42:34 +0100 |
commit | f42de3bbb2e04614724cb8299e4fa9c8581b34b6 (patch) | |
tree | 7c4541b13bf095e28c9d647ae219347bc49fbdcc /perllib/FixMyStreet/Geocode/OSM.pm | |
parent | f2b92da63ac147d18847396d9fb3d82231d73158 (diff) |
Geocoders: allow cobrands to fixup user's search string
This is useful, for example, if the cobrand has a list of common
typos that you want to account for.
Diffstat (limited to 'perllib/FixMyStreet/Geocode/OSM.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index d237f453b..4d57007c5 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -26,6 +26,8 @@ sub string { my ( $s, $c ) = @_; my $params = $c->cobrand->disambiguate_location($s); + # Allow cobrand to fixup the user input + $s = $params->{string} if $params->{string}; $s = FixMyStreet::Geocode::escape($s); $s .= '+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; |