CRM-18420 : Details field of a scheduled reminder contains raw HTML
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 19 Apr 2016 12:51:18 +0000 (18:21 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 19 Apr 2016 12:51:18 +0000 (18:21 +0530)
Civi/Token/TokenRow.php

index 55f509b7234277fc2a4fedac4dd421df69d68966..439a138cdb1d106cab4db80d9fbd66d6626556a6 100644 (file)
@@ -194,7 +194,15 @@ class TokenRow {
         foreach ($textTokens as $entity => $values) {
           foreach ($values as $field => $value) {
             if (!isset($htmlTokens[$entity][$field])) {
-              $htmlTokens[$entity][$field] = htmlentities($value);
+              // CRM-18420 - Activity Details Field are enclosed within <p>,
+              // hence if $body_text is empty, htmlentities will lead to
+              // conversion of these tags resulting in raw HTML.
+              if ($entity == 'activity' && $field == 'details') {
+                $htmlTokens[$entity][$field] = $value;
+              }
+              else {
+                $htmlTokens[$entity][$field] = htmlentities($value);
+              }
             }
           }
         }