fixed invalid UTF8 problem in guide indexer

fixes #6741
This commit is contained in:
Carsten Brandt
2015-01-10 21:09:19 +01:00
parent 08531312ef
commit 5fedb8da59
2 changed files with 3 additions and 3 deletions

View File

@ -38,8 +38,8 @@ class ApiIndexer extends Indexer
$description = strip_tags($matches[1]);
} elseif (preg_match('~<p>(.*?)</p>~s', $contents, $matches)) {
$description = strip_tags($matches[1]);
if (mb_strlen($description) > 1000) { // TODO truncate by words
$description = mb_substr($description, 0, 1000) . '...';
if (mb_strlen($description, 'UTF-8') > 1000) { // TODO truncate by words
$description = mb_substr($description, 0, 1000, 'UTF-8') . '...';
}
} else {
$description = '';