You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$smarty = new \Smarty();
$smarty->setEscapeHtml(true);
$smarty->assign('value', null);
var_dump($smarty->fetch('string:{$value}'));
Expected output:
string(0) ""
Output in php >= 8.1:
string(215) "
Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in ...\7f3eb64ac896f10d0f0414cf415a097993be285b_2.string.php on line 18
"
I could fix this problem with a "default"-modifier but I think smarty should be robust enough to prevent this kind of errors. I see the problem in this line here.
The {$output} should be casted to string to prevent this error.
The text was updated successfully, but these errors were encountered:
Code:
Expected output:
Output in php >= 8.1:
I could fix this problem with a "default"-modifier but I think smarty should be robust enough to prevent this kind of errors. I see the problem in this line here.
The
{$output}
should be casted to string to prevent this error.The text was updated successfully, but these errors were encountered: