From: larssandergreen Date: Thu, 7 Sep 2023 03:23:11 +0000 (-0600) Subject: rtrim when converting text tokens to html to avoid trailing newlines X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5055dbe87d097df9dd319afb007d108f53e86092;p=civicrm-core.git rtrim when converting text tokens to html to avoid trailing newlines --- diff --git a/Civi/Token/TokenRow.php b/Civi/Token/TokenRow.php index abaedda56e..dbe2a5ad8e 100644 --- a/Civi/Token/TokenRow.php +++ b/Civi/Token/TokenRow.php @@ -286,7 +286,7 @@ class TokenRow { $htmlTokens[$entity][$field] = \CRM_Utils_String::purifyHTML($value); } else { - $htmlTokens[$entity][$field] = is_object($value) ? $value : nl2br(htmlentities($value, ENT_QUOTES)); + $htmlTokens[$entity][$field] = is_object($value) ? $value : rtrim(nl2br(htmlentities($value, ENT_QUOTES))); } } }