-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render Note field tokens correctly - they are already HTML. #13283
Conversation
(Standard links)
|
Civi/Token/TokenRow.php
Outdated
@@ -225,6 +226,10 @@ public function fill($format = NULL) { | |||
if ($entity == 'activity' && $field == 'details') { | |||
$htmlTokens[$entity][$field] = $value; | |||
} | |||
elseif (\CRM_Utils_Array::value('data_type', \CRM_Utils_Array::value($field, $entityFields['values'])) == 'Memo') { | |||
// Memo fields aka custom fields of type Note are html. | |||
$htmlTokens[$entity][$field] = $value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 Could you review from a security perspective? Are we ok to insert html directly into tokens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aydun this is more likely to be considered secure if you use the CRM_Utils_String::purifyHTML()
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @colemanw - changed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw @seamuslee001 with this change is it mergeable?
Hmm - the test is not failing locally. Jenkins retest please. |
test this please |
Given Aydun has responded to Coleman's comment and it looks sensible to me i'm good with merging this |
Thanks @seamuslee001 |
Overview
Extracted from #13174 and #12012 Small bug fix so that tokens of Note fields are rendered correctly. They are already HTML so don't convert them to HTML again.