Commit 04c3474e authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix small omission - 'utf-8' as second parameter for an mb_strlen call.

parent 46c705ac
......@@ -2399,7 +2399,7 @@ function str_shorten($str, $maxlen=100, $truncate=false, $newlines=true) {
if ($truncate && mb_strlen($str, 'UTF-8') > $maxlen) {
$str = mb_substr($str, 0, $maxlen-3, 'UTF-8') . '...';
}
if (mb_strlen($str) > $maxlen) {
if (mb_strlen($str, 'UTF-8') > $maxlen) {
$str = mb_substr($str, 0, floor($maxlen / 2) - 1, 'UTF-8') . '...' . mb_substr($str, -(floor($maxlen / 2) - 2), mb_strlen($str, 'UTF-8'), 'UTF-8');
}
$str = nl2br(hsc($str));
......
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