Upgrade to 4.1.1
This commit is contained in:
@@ -488,7 +488,16 @@ class Str
|
||||
return $string;
|
||||
}
|
||||
|
||||
return static::substr($string, 0, mb_strrpos(static::substr($string, 0, $chars), ' ')) . $rep;
|
||||
// shorten the string to the specified number of characters,
|
||||
// but make sure to not cut off in the middle of a word
|
||||
$excerpt = static::substr($string, 0, $chars);
|
||||
$cutoff = mb_strrpos($excerpt, ' ');
|
||||
|
||||
if ($cutoff !== false) {
|
||||
$excerpt = static::substr($string, 0, $cutoff);
|
||||
}
|
||||
|
||||
return $excerpt . $rep;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user