diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-22 15:26:51 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-22 15:26:51 +0000 |
commit | e3c8c5d194a7a7dce70152f89c65616c8981c1a3 (patch) | |
tree | 281183e4345f8d9a400c4b651140f4055635a375 /perllib/FixMyStreet | |
parent | 3c97d45cb1a3803e74c43ef3eca3beb4a5d3ed23 (diff) |
Couple of URI escaping fixes, plus cope with different versions of LWP returning content/decoded_content.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 17a4d8539..803e32a85 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -106,6 +106,7 @@ sub string { || mySociety::Config::get('COUNTRY') ne 'GB'; $url .= '&sensor=false&key=' . mySociety::Config::get('GOOGLE_MAPS_API_KEY'); $js = LWP::Simple::get($url); + $js = encode_utf8($js) if utf8::is_utf8($js); File::Path::mkpath($cache_dir); File::Slurp::write_file($cache_file, $js) if $js && $js !~ /"code":6[12]0/; } |