CRM-18474 - Escape unicode characters to avoid json syntax errors
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 6 May 2016 10:52:58 +0000 (16:22 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 9 May 2016 09:50:42 +0000 (15:20 +0530)
replace by line break

ang/crmUtil.js

index d480279068239cb384be3ad958fa48a798d7af24..efe847cee72d34c6d2485b9e108045d6b9f31dbd 100644 (file)
       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 */