From e429c35ac45df6b714fdd4eb07b08a651b741bbf Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Mon, 15 Oct 2018 11:14:51 +0200 Subject: [PATCH] [dev/core#412] Avoid truncated UTF-8 strings when using substr() --- CRM/Core/BAO/Mapping.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 1764cd572f..3e8b324a36 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -997,9 +997,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { $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; } -- 2.25.1