* 0.9.10
+ * added a syntax error exception when parent block is used on a template that does not extend another one
* made the Escaper and Optimizer extensions enabled by default
* fixed sandbox extension when used with auto output escaping
* fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
}
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
+ if (!$this->parser->getParent()) {
+ throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend another one is forbidden', $token->getLine());
+ }
+
return new Twig_Node_Parent($this->parser->peekBlockStack(), $token->getLine(), $this->getTag());
}