aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-10-02 14:14:17 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-10-02 14:16:48 +0100
commitbf90bf71fbac2c8e1be96646715182f876eccd57 (patch)
tree1fbf4e2eb8e79745cf84d28d4c5db587baa209e8 /perllib/FixMyStreet/App/Controller
parentf4df25a3067a880d753b81df3eb4d3d843dc0ba0 (diff)
Don’t strip all spaces from Open311 categories.
If a category’s send method is Open311, only strip spaces from the ends of the code. We are aware of active Open311 servers that have codes with spaces in the middle.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
index f88ad0051..670336c14 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
@@ -252,8 +252,12 @@ sub update_contact : Private {
}
my $email = $c->get_param('email');
- $email =~ s/\s+//g;
my $send_method = $c->get_param('send_method') || $contact->body->send_method || "";
+ if ($send_method eq 'Open311') {
+ $email =~ s/^\s+|\s+$//g;
+ } else {
+ $email =~ s/\s+//g;
+ }
my $email_unchanged = $contact->email && $email && $contact->email eq $email;
my $cobrand = $contact->body->get_cobrand_handler;
my $cobrand_valid = $cobrand && $cobrand->call_hook(validate_contact_email => $email);