aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mytton <self@hecticjeff.net>2013-09-25 11:42:46 +0100
committerChris Mytton <self@hecticjeff.net>2013-09-25 11:42:46 +0100
commitf26fe9ff49a22eb532d4dea94158952d0bc01022 (patch)
treeb8073bcfc6a8741d393d5814ea6152ed1b70f3c5
parent2415d881317b8262c26720fa4d8c6c9757d1c345 (diff)
[Oxfordshire] Validate reports are < 1700 characters
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index f14a29f56..4fa442608 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -388,9 +388,14 @@ sub check_for_errors {
$self->category(undef);
}
- if ( $self->bodies_str && $self->detail &&
- $self->bodies_str eq '2482' && length($self->detail) > 2000 ) {
- $errors{detail} = _('Reports are limited to 2000 characters in length. Please shorten your report');
+ if ( $self->bodies_str && $self->detail ) {
+ if ( $self->bodies_str eq '2482' && length($self->detail) > 2000 ) {
+ $errors{detail} = _('Reports are limited to 2000 characters in length. Please shorten your report');
+ }
+
+ if ( $self->bodies_str eq '2237' && length($self->detail) > 1700 ) {
+ $errors{detail} = _('Reports are limited to 1700 characters in length. Please shorten your report');
+ }
}
return \%errors;