Fix no-cond-assign in ES5

[MAILPOET-1033]
This commit is contained in:
Pavel Dohnal
2017-08-16 10:39:43 +02:00
parent 7725391eff
commit 89b51b6215
3 changed files with 6 additions and 4 deletions

View File

@@ -315,11 +315,13 @@ define(
// remove urlencoded characters
.replace(/\s+|%\d+|,+/g, '');
// detect e-mails that will be otherwise rejected by email regex
if (test = /<(.*?)>/.exec(email)) {
test = /<(.*?)>/.exec(email);
if (test) {
// is the email inside angle brackets (e.g., 'some@email.com <some@email.com>')?
email = test[1].trim();
}
if (test = /mailto:(?:\s+)?(.*)/.exec(email)) {
test = /mailto:(?:\s+)?(.*)/.exec(email);
if (test) {
// is the email in 'mailto:email' format?
email = test[1].trim();
}