Skip to content

Commit

Permalink
Resolve #9 by purifying label of entity reference values
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 committed Feb 19, 2019
1 parent 047faf6 commit dbf86a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CRM/Core/Form/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ public static function preProcessEntityRef($field) {
$params = $field->getAttribute('data-api-params');
$params = $params ? json_decode($params, TRUE) : array();
$result = civicrm_api3($entity, 'getlist', array('id' => $val) + $params);
// Purify label output of entityreference fields
if (!empty($result['values'])) {
foreach ($result['values'] as &$res) {
if (!empty($res['label'])) {
$res['label'] = CRM_Utils_String::purifyHTML($res['label']);
}
}
}
if ($field->isFrozen()) {
// Prevent js from treating frozen entityRef as a "live" field
$field->removeAttribute('class');
Expand Down

0 comments on commit dbf86a7

Please sign in to comment.