here a patch:
:::php
static function truncate($text)
{
$instance = MyTextSanitizer::getInstance();
if (empty($text) || empty($instance->config['truncate_length']) || strlen($text) < $instance->config['truncate_length']) {
return $text;
}
$gap = $instance->config['truncate_length'] - 5;
if ($gap > 0) {
$len = floor(($instance->config['truncate_length'] - 5) / 2);
$ret = substr($text, 0, $len) . ' ... ' . substr($text, -$len);
} else {
$ret = substr($text, 0, 2) . '...';
}
return $ret;
}
Teste version : 2.6.0 alpha 1