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:
149e657
)
CRM-18997 DB error, incorrect truncating multibyte string
author
sunil
<esunil.pawar@gmail.com>
Thu, 23 Jun 2016 09:41:04 +0000
(15:11 +0530)
committer
sunil
<esunil.pawar@gmail.com>
Thu, 23 Jun 2016 09:41:04 +0000
(15:11 +0530)
CRM/Utils/String.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/String.php
b/CRM/Utils/String.php
index 90a09b45343b24df507d1e29c5f0b86bae211996..8488130702f6ffd7809c2c14b921af3e1ce9e867 100644
(file)
--- a/
CRM/Utils/String.php
+++ b/
CRM/Utils/String.php
@@
-651,7
+651,12
@@
class CRM_Utils_String {
return $string;
}
else {
- return substr($string, 0, $maxLen - 3) . '...';
+ $end = $maxLen - 3;
+ while (strlen($string) > $maxLen - 3) {
+ $string = mb_substr($string, 0, $end, 'UTF-8');
+ $end = $end - 1;
+ }
+ return $string . '...';
}
}