Commit 432bcab8 authored by Nigel McNie's avatar Nigel McNie
Browse files

(#3271) Use str_shorten_html() to shorten the blog text, so Chinese characters aren't destroyed.

parent 5bb15073
......@@ -175,13 +175,7 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
$blognames[$artefact->parent] = get_field('artefact', 'title', 'id', $artefact->parent);
}
$artefact->blog = $blognames[$artefact->parent];
$ellipsis = '';
$artefact->description = trim(strip_tags($artefact->description));
if (strlen($artefact->description) > 100) {
$ellipsis = '…';
}
$artefact->description = substr($artefact->description, 0, 100) . $ellipsis;
$artefact->description = str_shorten_html($artefact->description, 50, true);
return $artefact;
}
......
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