Bug 1799390 - Improve pill email validation to at least not allow space and double @. r=aleca
From https://stackoverflow.com/questions/46155/how-can-i-validate-an-email-address-in-javascript#answer-9204568 Differential Revision: https://phabricator.services.mozilla.com/D162383 --HG-- extra : rebase_source : a324290179142e7b27b98b905c44c0b6b0fbcdca extra : amend_source : d897527d05909b6aff67b6f7470c5bb3f8266c74
This commit is contained in:
Родитель
5f617743e0
Коммит
bd5b24388a
|
@ -1264,7 +1264,7 @@
|
|||
* @param {String} address - An email address.
|
||||
*/
|
||||
isValidAddress(address) {
|
||||
return address.includes("@", 1) && !address.endsWith("@");
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(address);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче