use multibyte-aware mb_strlen() instead of strlen(); fixed issue #8)
This commit is contained in:
1 parent
825317ec38
commit
6a02dfd5aa
4 files changed
+21
-15
No files matched your search
@@ -72,7 +72,7 @@ function twig_sprintf_filter( $value, $var) {
|
||||
}
|
||||
|
||||
function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') {
|
||||
if (strlen($value) > $length) {
|
||||
if (mb_strlen($value) > $length) {
|
||||
if ($preserve) {
|
||||
if (false !== ($breakpoint = strpos($value, ' ', $length))) {
|
||||
$length = $breakpoint;
|
||||
|
||||
Reference in new issue
Block a user