Skip to content

Commit

Permalink
Merge pull request #12935 from jensschuppe/core-412
Browse files Browse the repository at this point in the history
[dev/core#412] Avoid truncated UTF-8 strings when using substr()
  • Loading branch information
eileenmcnaughton authored Oct 18, 2018
2 parents 739e971 + e429c35 commit 51ffa35
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions CRM/Core/BAO/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,7 @@ public static function getCustomGroupName($customfieldId) {
$customGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $customFieldId, 'custom_group_id');
$customGroupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'title');

if (strlen($customGroupName) > 13) {
$customGroupName = substr($customGroupName, 0, 10) . '...';
}
$customGroupName = CRM_Utils_String::ellipsify($customGroupName, 13);

return $customGroupName;
}
Expand Down

0 comments on commit 51ffa35

Please sign in to comment.