From 76bb57bc6bfed3726d11b6c0c02a510b04139ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 May 2020 18:50:37 +0200 Subject: [PATCH] enhance free email --- htdocs/core/class/html.form.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1097692d61a..49758d55be7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6699,9 +6699,10 @@ class Form var match = params.term.match(new RegExp("^" + REGEX_EMAIL + "$", "i")); // console.log(match); if (match !== null) { + var pos = params.term.indexOf("@"); return { - id: $.trim(match[1]) + " <" + match[1] + ">", - text: $.trim(match[1]) + " <" + match[1] + ">" + id: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">", + text: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">" } } return null;