diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Template/SafeString.pm | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 7dfda1a4c..7168e8379 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -299,7 +299,8 @@ sub format_problem_for_display : Private { delete $report_hashref->{created}; delete $report_hashref->{confirmed}; - my $content = encode_json( + my $json = JSON::MaybeXS->new( convert_blessed => 1, utf8 => 1 ); + my $content = $json->encode( { report => $report_hashref, updates => $c->cobrand->updates_as_hashref( $problem, $c ), diff --git a/perllib/FixMyStreet/Template/SafeString.pm b/perllib/FixMyStreet/Template/SafeString.pm index 619bee048..263937b39 100644 --- a/perllib/FixMyStreet/Template/SafeString.pm +++ b/perllib/FixMyStreet/Template/SafeString.pm @@ -69,6 +69,12 @@ sub clone { return $clone; } +sub TO_JSON { + my $self = shift; + + return $$self; +} + 1; __END__ |