Commit 84132422 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Merge branch 'fix/19647_validate_email_adress' into 'develop'

fix(19647) : changing the pattern regex in html to prevent validation error...

See merge request !717
parents 1117f5ae fd26392e
Pipeline #17721 failed with stages
in 33 seconds
......@@ -223,6 +223,11 @@ class userAccount
$userAccount->accountId = \laabs::newId();
$userAccount->accountType = 'user';
if (!is_null($userAccount->emailAddress) && !filter_var($userAccount->emailAddress, FILTER_VALIDATE_EMAIL)) {
$validationErrors = ["Email malformed"];
throw \laabs::newException("auth/invalidUserInformationException", $validationErrors);
}
$organizationController = \laabs::newController('organization/organization');
if (!is_null($organizations)) {
$organization = $organizationController->read($organizations[0]);
......
......@@ -279,7 +279,7 @@
}
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailReg = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
return emailReg.test($email);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment