Allow null for nl2br, striptags and format filters

Same as https://github.com/twigphp/Twig/pull/3617
This commit is contained in:
Ruud Kamphuis
2022-01-03 14:00:34 +01:00
parent e155d8dcfc
commit e9cd55def5
5 changed files with 66 additions and 4 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ class TwigTestExtension extends AbstractExtension
{
// not secure if $value contains html tags (not only entities)
// don't use
return str_replace("\n", "$sep\n", $value);
return str_replace("\n", "$sep\n", $value ?? '');
}
public function dynamic_path($element, $item)