Use css to truncate the page title

This commit is contained in:
Frederic Guillot
2015-06-15 20:30:30 -04:00
parent 100330c989
commit 57dd45839b
5 changed files with 13 additions and 5 deletions

View File

@@ -51,10 +51,10 @@ class Text extends \Core\Base
*/
public function truncate($value, $max_length = 85, $end = '[...]')
{
$length = strlen($value);
$length = mb_strlen($value);
if ($length > $max_length) {
return substr($value, 0, $max_length).' '.$end;
return mb_substr($value, 0, $max_length).' '.$end;
}
return $value;