Handle multibyte strings in truncateLetters (#2007)

This commit is contained in:
Jeremy Bouquain
2018-06-08 23:37:06 +02:00
committed by Andy Miller
parent 9053f9ab44
commit f883820c6a

View File

@@ -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)) {