mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
fixed infinite loop in inheritance (closes #66)
This commit is contained in:
@@ -27,7 +27,7 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter
|
||||
|
||||
protected function getParent($context, $parents)
|
||||
{
|
||||
return call_user_func($parents[0], $context, array_slice($parents, 0));
|
||||
return call_user_func($parents[0], $context, array_slice($parents, 1));
|
||||
}
|
||||
|
||||
public function pushBlocks($blocks)
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
"extends" tag
|
||||
--TEMPLATE--
|
||||
{% extends "layout.twig" %}{% block content %}{% parent %}index {% endblock %}
|
||||
--TEMPLATE(layout.twig)--
|
||||
{% extends "base.twig" %}{% block content %}{% parent %}layout {% endblock %}
|
||||
--TEMPLATE(base.twig)--
|
||||
{% block content %}base {% endblock %}
|
||||
--DATA--
|
||||
return array()
|
||||
--EXPECT--
|
||||
base layout index
|
||||
Reference in New Issue
Block a user