diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Photo.pm | 5 |
1 files changed, 2 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 |