mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-12 01:49:53 +01:00
Merge branch 'master' into smarty5
This commit is contained in:
@@ -651,7 +651,7 @@ class DefaultExtension extends Base {
|
||||
*/
|
||||
public function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
|
||||
{
|
||||
if ($length === 0) {
|
||||
if ($length === 0 || $string === null) {
|
||||
return '';
|
||||
}
|
||||
if (mb_strlen($string, \Smarty\Smarty::$_CHARSET) > $length) {
|
||||
|
||||
Reference in New Issue
Block a user