From b328500e5c984d3f7d63c2e3de8b086cb9174a27 Mon Sep 17 00:00:00 2001 From: Jeremy Bouquain Date: Fri, 4 May 2018 00:14:55 +0200 Subject: [PATCH] Handle multibyte strings in truncateLetters --- system/src/Grav/Common/Helpers/Truncator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Helpers/Truncator.php b/system/src/Grav/Common/Helpers/Truncator.php index c2e7349893..611f693999 100644 --- a/system/src/Grav/Common/Helpers/Truncator.php +++ b/system/src/Grav/Common/Helpers/Truncator.php @@ -104,7 +104,7 @@ public static function truncateLetters($html, $limit = 0, $ellipsis = "") if ($letters->key() >= $limit) { $currentText = $letters->currentTextPosition(); - $currentText[0]->nodeValue = substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); + $currentText[0]->nodeValue = mb_substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); self::removeProceedingNodes($currentText[0], $body); if (!empty($ellipsis)) {