smarty icon indicating copy to clipboard operation
smarty copied to clipboard

count_characters for null value deprecated issue

Open greggebura opened this issue 8 months ago • 0 comments

If i use count_characters modifier for null value it returns deprecated error

preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated

$smarty = new Smarty\Smarty();
$smarty->setCompileDir('/tmp');
$smarty->assign('field', null);
var_dump($smarty->fetch('string:{if $field|count_characters>7}1{/if}'));

greggebura avatar Feb 28 '25 06:02 greggebura