projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56d3977
)
Use mb_strlen() in ellipsify() to avoid excessive multibyte truncation
author
mark burdett
<mfburdett@gmail.com>
Fri, 26 Jan 2018 20:48:25 +0000
(12:48 -0800)
committer
mark burdett
<mfburdett@gmail.com>
Fri, 26 Jan 2018 20:48:25 +0000
(12:48 -0800)
CRM/Utils/String.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/String.php
b/CRM/Utils/String.php
index be6ba732a99f56dcc35b549f14640b90f145df09..9b0fdcbf07b64338e458aba4e986f0423bdec7f9 100644
(file)
--- a/
CRM/Utils/String.php
+++ b/
CRM/Utils/String.php
@@
-657,13
+657,13
@@
class CRM_Utils_String {
* @return string
*/
public static function ellipsify($string, $maxLen) {
- $len =
strlen($string
);
+ $len =
mb_strlen($string, 'UTF-8'
);
if ($len <= $maxLen) {
return $string;
}
else {
$end = $maxLen - 3;
- while (
strlen($string
) > $maxLen - 3) {
+ while (
mb_strlen($string, 'UTF-8'
) > $maxLen - 3) {
$string = mb_substr($string, 0, $end, 'UTF-8');
$end = $end - 1;
}