From f883820c6afcaacae843dd2b89af6e0156e1e032 Mon Sep 17 00:00:00 2001 From: Jeremy Bouquain Date: Fri, 8 Jun 2018 23:37:06 +0200 Subject: [PATCH] Handle multibyte strings in truncateLetters (#2007) --- 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 b2a19dbc2..474aae1bc 100644 --- a/system/src/Grav/Common/Helpers/Truncator.php +++ b/system/src/Grav/Common/Helpers/Truncator.php @@ -113,7 +113,7 @@ class Truncator { 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)) {