diff --git a/src/bundle/auth/Controller/userAccount.php b/src/bundle/auth/Controller/userAccount.php index 6f013bc3fcedf92c8a32530d8fd62cde90b50d6c..e069073355acfc4ca17735a8f6bc9ac5d86f4452 100755 --- a/src/bundle/auth/Controller/userAccount.php +++ b/src/bundle/auth/Controller/userAccount.php @@ -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]); diff --git a/src/presentation/maarchRM/Resources/view/auth/userAccount/admin/edit.html b/src/presentation/maarchRM/Resources/view/auth/userAccount/admin/edit.html index 433a8675c7c64a47f7026e2b91e314a3765c078a..da2c8717368d793d566bdc7cd22019d2ea33e78e 100755 --- a/src/presentation/maarchRM/Resources/view/auth/userAccount/admin/edit.html +++ b/src/presentation/maarchRM/Resources/view/auth/userAccount/admin/edit.html @@ -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); }