aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm5
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm3
2 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index df4cab2d8..bfb1c5535 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -4,7 +4,7 @@ use namespace::autoclean;
BEGIN {extends 'Catalyst::Controller'; }
-use JSON;
+use JSON::MaybeXS;
use File::Path;
use File::Slurp;
use FixMyStreet::App::Model::PhotoSet;
@@ -112,9 +112,8 @@ sub upload : Local {
$out = { id => $fileid };
}
- my $body = JSON->new->utf8(1)->encode($out);
$c->res->content_type('application/json; charset=utf-8');
- $c->res->body($body);
+ $c->res->body(encode_json($out));
}
=head2 process_photo
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 55b1bb21c..d26e0fa70 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -7,6 +7,7 @@ use CronFns;
use DateTime::Format::Pg;
use Utils;
+use Utils::OpenStreetMap;
use mySociety::MaPit;
use FixMyStreet;
@@ -91,8 +92,10 @@ sub send(;$) {
: _('The user could not locate the problem on a map, but to see the area around the location they entered');
$h{closest_address} = '';
+ $h{osm_url} = Utils::OpenStreetMap::short_url($h{latitude}, $h{longitude});
if ( $row->used_map ) {
$h{closest_address} = $cobrand->find_closest( $h{latitude}, $h{longitude}, $row );
+ $h{osm_url} .= '?m';
}
if ( $cobrand->allow_anonymous_reports &&