fix email address escaped
This commit is contained in:
@@ -385,6 +385,8 @@ class EmailFromAddressVarchar extends BaseFieldView {
|
||||
*/
|
||||
createPerson(scope, address) {
|
||||
const fromString = this.model.get('fromString') || this.model.get('fromName');
|
||||
|
||||
/** @type {string|null} */
|
||||
let name = this.nameHash[address] || null;
|
||||
|
||||
if (!name && this.name === 'from' && fromString) {
|
||||
@@ -394,7 +396,7 @@ class EmailFromAddressVarchar extends BaseFieldView {
|
||||
}
|
||||
|
||||
if (name) {
|
||||
name = this.getHelper().escapeString(name);
|
||||
name = EmailFromAddressVarchar.stripQuotesFromName(name);
|
||||
}
|
||||
|
||||
const attributes = {
|
||||
@@ -465,7 +467,7 @@ class EmailFromAddressVarchar extends BaseFieldView {
|
||||
}
|
||||
|
||||
if (name) {
|
||||
name = this.getHelper().escapeString(name);
|
||||
name = EmailFromAddressVarchar.stripQuotesFromName(name);
|
||||
}
|
||||
|
||||
const attributes = {
|
||||
@@ -558,6 +560,19 @@ class EmailFromAddressVarchar extends BaseFieldView {
|
||||
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() {
|
||||
const value = this.$element.val().trim();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user