mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
remove unnecessary param for preg
This commit is contained in:
@@ -34,7 +34,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...',
|
||||
if (mb_strlen($string) > $length) {
|
||||
$length -= min($length, mb_strlen($etc));
|
||||
if (!$break_words && !$middle) {
|
||||
$string = preg_replace('/\s+?(\S+)?$/u', '', mb_substr($string, 0, $length + 1), 'p');
|
||||
$string = preg_replace('/\s+?(\S+)?$/u', '', mb_substr($string, 0, $length + 1));
|
||||
}
|
||||
if (!$middle) {
|
||||
return mb_substr($string, 0, $length) . $etc;
|
||||
|
Reference in New Issue
Block a user