This commit is contained in:
Fabien Potencier
2025-02-14 12:56:13 +01:00
parent 640b382a51
commit 151aa4ecda
32 changed files with 44 additions and 71 deletions
+1 -1
View File
@@ -549,7 +549,7 @@ class Parser
// here, $nested means "being at the root level of a child template"
// we need to discard the wrapping "Node" for the "body" node
// Node::class !== \get_class($node) should be removed in Twig 4.0
$nested = $nested || (Node::class !== \get_class($node) && !$node instanceof Nodes);
$nested = $nested || (Node::class !== $node::class && !$node instanceof Nodes);
foreach ($node as $k => $n) {
if (null !== $n && null === $this->filterBodyNodes($n, $nested)) {
$node->removeNode($k);