diff --git a/api/js/etemplate/Et2Url/Et2UrlEmailReadonly.ts b/api/js/etemplate/Et2Url/Et2UrlEmailReadonly.ts index 15fead0065..f17032eb0d 100644 --- a/api/js/etemplate/Et2Url/Et2UrlEmailReadonly.ts +++ b/api/js/etemplate/Et2Url/Et2UrlEmailReadonly.ts @@ -11,7 +11,6 @@ import {IsEmail} from "../Validators/IsEmail"; import {Et2UrlEmail} from "./Et2UrlEmail"; import {Et2UrlReadonly} from "./Et2UrlReadonly"; -import {Et2EmailTag} from "../Et2Select/Tag/Et2EmailTag"; /** * @customElement et2-url-email_ro @@ -89,7 +88,7 @@ export class Et2UrlEmailReadonly extends Et2UrlReadonly { let email; if (IsEmail.EMAIL_PREG.exec(email=this.value) || - IsEmail.EMAIL_PREG.exec(email=this.value+' <'+this.statustext+'>')) + IsEmail.EMAIL_PREG.exec(email = '"' + this.value + '" <' + this.statustext + '>')) { Et2UrlEmail.action(email); } diff --git a/api/js/jsapi/egw_open.js b/api/js/jsapi/egw_open.js index b3bdfe92fb..5c3caa9228 100644 --- a/api/js/jsapi/egw_open.js +++ b/api/js/jsapi/egw_open.js @@ -57,6 +57,17 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) bcc: match['bcc'] || [] }; + // No CSV, split them here and pay attention to quoted commas + const split_regex = /("[^"]*" <[^>]*>)|("[^"]*")|('[^']*')|([^,]+)/g; + for (let index in content) + { + if (typeof content[index] == "string") + { + const matches = content[index].match(split_regex); + content[index] = matches ?? content[index]; + } + } + // Encode html entities in the URI, otheerwise server XSS protection wont // allow it to pass, because it may get mistaken for some forbiden tags, // e.g., "Mathias " the first part of email " 0) { - var cLen = content[index].split(','); + var cLen = content[index]; egw.message(egw.lang('%1 email(s) added into %2', cLen.length, egw.lang(index))); return; }