Merge branch 'master' into smarty5

This commit is contained in:
Simon Wisselink
2023-01-24 12:53:58 +01:00
15 changed files with 8 additions and 48 deletions

View File

@@ -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) {