Subscribers import: Step1 also uses the email regexp to validate emails [MAILPOET-1288]

This commit is contained in:
Rostislav Wolny
2018-03-08 11:39:09 +01:00
parent 755179e0d1
commit d079002b09

View File

@@ -164,8 +164,9 @@ define(
// is the email in 'mailto:email' format?
email = test[1].trim();
}
// test for valid characters using WP's rule (https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/formatting.php#L2902)
if (!/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-@]+$/.test(email)) {
// validate email
if (!window.mailpoet_email_regex.test(email)) {
return false;
}
return email;