diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index e37e08698..60f7ac903 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -335,8 +335,18 @@ sub inspect : Private { my %update_params = (); if ($permissions->{report_inspect}) { - foreach (qw/detailed_information traffic_information/) { - $problem->set_extra_metadata( $_ => $c->get_param($_) ); + $problem->set_extra_metadata( traffic_information => $c->get_param('traffic_information') ); + + if ( my $info = $c->get_param('detailed_information') ) { + $problem->set_extra_metadata( detailed_information => $info ); + if (length($info) > 172) { + $valid = 0; + push @{ $c->stash->{errors} }, + sprintf( + _('Detailed information is limited to %d characters.'), + $c->cobrand->max_detailed_info_length + ); + } } if ( $c->get_param('defect_type') ) { |