Adjusts WP's email validation regex syntax to JS
This commit is contained in:
@@ -324,7 +324,7 @@ define(
|
||||
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) ) {
|
||||
if (!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.\-@]+$/.test(email) ) {
|
||||
return false;
|
||||
}
|
||||
return email;
|
||||
|
Reference in New Issue
Block a user