Merge pull-request #361

This commit is contained in:
Frederic Guillot 2015-04-21 18:20:51 -04:00
commit a39f18f477

View File

@ -116,7 +116,11 @@ function summary($value, $min_length = 5, $max_length = 120, $end = '[...]')
$length = strlen($value);
if ($length > $max_length) {
return substr($value, 0, strpos($value, ' ', $max_length)).' '.$end;
$max = strpos($value, ' ', $max_length);
if ($max === false) {
$max = $max_length;
}
return substr($value, 0, $max).' '.$end;
}
else if ($length < $min_length) {
return '';