diff options
author | Struan Donald <struan@exo.org.uk> | 2019-07-29 17:30:56 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-08-02 09:38:05 +0100 |
commit | 6dc425da8743d68a10edc778dc36593e9b754ed8 (patch) | |
tree | f912f3289c0ab3213d72fc775020c944b7efa5ad /t/app/controller | |
parent | c21d5b650fcd7e5b745461628b5eb48c1f22ac23 (diff) |
prevent including email address in report title
If autofill on Chrome is turned on and has saved the user's login it
can autofill the user's email address in the report title, so add
validation to make sure the title does not look like an email.
Fixes #2570
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_new.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index e824eb143..417d91ef9 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -519,6 +519,29 @@ foreach my $test ( errors => [ "Please enter a subject" ], }, { + msg => 'email in title', + pc => 'SW1A 1AA', + fields => { + title => 'user@example.com', + detail => 'Test detail', + photo1 => '', + photo2 => '', + photo3 => '', + name => 'Joe Smith', + may_show_name => '1', + username => 'user@example.com', + phone => '', + category => 'Street lighting', + password_sign_in => '', + password_register => '', + }, + changes => { + username => 'user@example.com', + title => 'User@example.com' + }, + errors => [ 'Please make sure you are not including an email address', ], + }, + { msg => 'Bromley long detail', pc => 'BR1 3UH', fields => { |