mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-11 04:36:47 +00:00
Fixed: Endless loop if more than one parent without the macro exists
This commit is contained in:
committed by
Fabien Potencier
parent
0840c7902b
commit
4497083325
@@ -1083,7 +1083,8 @@ function twig_capitalize_string_filter(Environment $env, $string)
|
||||
function twig_call_macro(Template $template, string $method, array $args, int $lineno, array $context, Source $source)
|
||||
{
|
||||
if (!method_exists($template, $method)) {
|
||||
while ($parent = $template->getParent($context)) {
|
||||
$parent = $template;
|
||||
while ($parent = $parent->getParent($context)) {
|
||||
if (method_exists($parent, $method)) {
|
||||
return $parent->$method(...$args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user