[FIX] web_settings_dashboard: lessen constraint on email when inviting

Even completely valid simple email like alfred+toto@example.com was not
considered as valid. As email may contain a lot of characters and strange
stuff let us be less strict on validation.

This commit is related to task ID 1839609. Closes #24576.
This commit is contained in:
Thibault Delavallée
2018-05-28 13:29:48 +02:00
parent 42ad3da366
commit 6502c98b99
@@ -141,7 +141,7 @@ var DashboardInvitations = Widget.extend({
* @returns {boolean} true iff the given email address is valid
*/
_validateEmail: function (email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,63}(?:\.[a-z]{2})?)$/i;
var re = /^([a-z0-9][-a-z0-9_\+\.]*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,63}(?:\.[a-z]{2})?)$/i;
return re.test(email);
},
on_access_rights_clicked: function (e) {