Commit 0a860919 by Carsten Brandt

use mb_ string functions to truncate description

parent f67c4db7
...@@ -30,8 +30,8 @@ class ApiIndexer extends Indexer ...@@ -30,8 +30,8 @@ class ApiIndexer extends Indexer
$description = strip_tags($matches[1]); $description = strip_tags($matches[1]);
} elseif (preg_match('~<p>(.*?)</p>~s', $contents, $matches)) { } elseif (preg_match('~<p>(.*?)</p>~s', $contents, $matches)) {
$description = strip_tags($matches[1]); $description = strip_tags($matches[1]);
if (strlen($description) > 1000) { // TODO truncate by words if (mb_strlen($description) > 1000) { // TODO truncate by words
$description = substr($description, 0, 1000) . '...'; $description = mb_substr($description, 0, 1000) . '...';
} }
} else { } else {
$description = ''; $description = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment