fixed infinite loop in inheritance (closes #66)

This commit is contained in:
Fabien Potencier
2010-06-11 07:10:43 +02:00
parent fa57407290
commit 40b16eccf8
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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
View File
@@ -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