fix email address escaped

This commit is contained in:
Yurii
2026-02-27 15:03:40 +02:00
parent 9166277a01
commit 669e78e072
@@ -385,6 +385,8 @@ class EmailFromAddressVarchar extends BaseFieldView {
*/ */
createPerson(scope, address) { createPerson(scope, address) {
const fromString = this.model.get('fromString') || this.model.get('fromName'); const fromString = this.model.get('fromString') || this.model.get('fromName');
/** @type {string|null} */
let name = this.nameHash[address] || null; let name = this.nameHash[address] || null;
if (!name && this.name === 'from' && fromString) { if (!name && this.name === 'from' && fromString) {
@@ -394,7 +396,7 @@ class EmailFromAddressVarchar extends BaseFieldView {
} }
if (name) { if (name) {
name = this.getHelper().escapeString(name); name = EmailFromAddressVarchar.stripQuotesFromName(name);
} }
const attributes = { const attributes = {
@@ -465,7 +467,7 @@ class EmailFromAddressVarchar extends BaseFieldView {
} }
if (name) { if (name) {
name = this.getHelper().escapeString(name); name = EmailFromAddressVarchar.stripQuotesFromName(name);
} }
const attributes = { const attributes = {
@@ -558,6 +560,19 @@ class EmailFromAddressVarchar extends BaseFieldView {
Espo.Ui.notify(); Espo.Ui.notify();
} }
/**
* @private
* @param {string} name
* @return {string}
*/
static stripQuotesFromName(name) {
if (name && /^(['"]).*\1$/.test(name)) {
name = name.substring(1, name.length - 1);
}
return name;
}
fetchSearch() { fetchSearch() {
const value = this.$element.val().trim(); const value = this.$element.val().trim();