[DEV-6756] Prevent special chars from "local-part" of email address
Merge branch 'jira-6756' * jira-6756: [DEV-6756] Prevent special chars from "local-part" of email addressmaster
commit
8ae6e236e9
|
@ -22,7 +22,7 @@
|
|||
// characters allowed in local-part, omitting dot (some of these are only
|
||||
// allowed within quotes, but we're not going to bother convuluting the regex
|
||||
// with that)
|
||||
var local_chars = '[a-zA-Z0-9!#$%&\'*+/=?^_1{|}~()\\\\" (),:;<>@\\[\\]-]';
|
||||
var local_chars = '[a-zA-Z0-9!#$%&\'*+/=?^_1{|}~-]';
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,6 @@ describe( 'validate.formatter.StringFormat', function()
|
|||
"firstname.lastname@domain.com",
|
||||
"email@subdomain.domain.com",
|
||||
"firstname+lastname@domain.com",
|
||||
'email"@domain.com',
|
||||
"1234567890@domain.com",
|
||||
"email@domain-one.com",
|
||||
"_______@domain.com",
|
||||
|
@ -50,7 +49,7 @@ describe( 'validate.formatter.StringFormat', function()
|
|||
"@domain.com",
|
||||
"Joe Smith <email@domain.com>",
|
||||
"email.domain.com",
|
||||
// "email@domain@domain.com",
|
||||
"email@domain@domain.com",
|
||||
".email@domain.com",
|
||||
"email.@domain.com",
|
||||
"email..email@domain.com",
|
||||
|
@ -59,5 +58,17 @@ describe( 'validate.formatter.StringFormat', function()
|
|||
"email@domain",
|
||||
"email@-domain.com",
|
||||
"email@domain..com",
|
||||
"em,ail@domain.com",
|
||||
'em"ail@domain.com',
|
||||
"em(ail@domain.com",
|
||||
"em)ail@domain.com",
|
||||
"em:ail@domain.com",
|
||||
"em;ail@domain.com",
|
||||
"em<ail@domain.com",
|
||||
"em>ail@domain.com",
|
||||
"em[ail@domain.com",
|
||||
"em]ail@domain.com",
|
||||
"em ail@domain.com",
|
||||
"em\\ail@domain.com",
|
||||
].forEach( email_address => assert.throws( () => Sut.parse( email_address ), Error ) );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue