Skip to content

Commit

Permalink
Fix deprecation in ForbiddenFilterRule.php (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudk authored Aug 30, 2024
1 parent befa5ac commit a0e552f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Rules/Node/ForbiddenFilterRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function enterNode(Node $node, Environment $env): Node
return $node;
}

$filterName = $node->getNode('filter')->getAttribute('value');
$filterName = $node->hasAttribute('name')
? $node->getAttribute('name')
: $node->getNode('filter')->getAttribute('value'); // BC for twig/twig < 3.12
if (!\in_array($filterName, $this->filters, true)) {
return $node;
}
Expand Down

0 comments on commit a0e552f

Please sign in to comment.