diff --git a/client/lib/handleError.js b/client/lib/handleError.js index cf4eb5d87f4..821d7e7cb0d 100644 --- a/client/lib/handleError.js +++ b/client/lib/handleError.js @@ -3,14 +3,14 @@ this.handleError = function(error, useToastr = true) { if (_.isObject(error.details)) { for (const key in error.details) { if (error.details.hasOwnProperty(key)) { - error.details[key] = TAPi18n.__(_.escapeHTML(error.details[key])); + error.details[key] = TAPi18n.__(error.details[key]); } } } if (useToastr) { - return toastr.error(TAPi18n.__(error.error, error.details), error.details && error.details.errorTitle ? TAPi18n.__(error.details.errorTitle) : null); + return toastr.error(_.escapeHTML(TAPi18n.__(error.error, error.details)), error.details && error.details.errorTitle ? _.escapeHTML(TAPi18n.__(error.details.errorTitle)) : null); } - return TAPi18n.__(error.error, error.details); + return _.escapeHTML(TAPi18n.__(error.error, error.details)); };