From: jitendrapurohit Date: Fri, 6 May 2016 10:52:58 +0000 (+0530) Subject: CRM-18474 - Escape unicode characters to avoid json syntax errors X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=53dab8be9ed807a10ea4669131b8e5efb289e489;p=civicrm-core.git CRM-18474 - Escape unicode characters to avoid json syntax errors replace by line break --- diff --git a/ang/crmUtil.js b/ang/crmUtil.js index d480279068..efe847cee7 100644 --- a/ang/crmUtil.js +++ b/ang/crmUtil.js @@ -16,6 +16,11 @@ var deferred = $q.defer(); var p; var backend = crmApi.backend || CRM.api3; + if (params.body_html) { + // CRM-18474 - remove Unicode Character 'LINE SEPARATOR' (U+2028) + // and 'PARAGRAPH SEPARATOR' (U+2029) from the html if present. + params.body_html = params.body_html.replace(/([\u2028]|[\u2029])/g, '\n'); + } if (_.isObject(entity)) { // eval content is locally generated. /*jshint -W061 */