summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Node/SandboxedModule.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-01 23:43:20 -0400
committerczaks <marcin@6irc.net>2013-08-01 23:43:20 -0400
commit1ed45ebe9e39724ec70098abfcd267d8ac478511 (patch)
treeda133b7426dedaf0785f64be752aa0437de7e80a /inc/lib/Twig/Node/SandboxedModule.php
parentdc84ccc6a8e0b6fd3fc626eb1f321e4cf2d05511 (diff)
parent40ab2e0c1728fab613bc16a19ab8fcb3fa78c1d4 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: stylesheets/dark.css stylesheets/futaba+vichan.css stylesheets/miku.css stylesheets/stripes.css stylesheets/testorange.css stylesheets/wasabi.css
Diffstat (limited to 'inc/lib/Twig/Node/SandboxedModule.php')
-rw-r--r--inc/lib/Twig/Node/SandboxedModule.php23
1 files changed, 6 insertions, 17 deletions
diff --git a/inc/lib/Twig/Node/SandboxedModule.php b/inc/lib/Twig/Node/SandboxedModule.php
index 36d9f198..be1f5daa 100644
--- a/inc/lib/Twig/Node/SandboxedModule.php
+++ b/inc/lib/Twig/Node/SandboxedModule.php
@@ -13,8 +13,7 @@
/**
* Represents a module node.
*
- * @package twig
- * @author Fabien Potencier <fabien@symfony.com>
+ * @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Node_SandboxedModule extends Twig_Node_Module
{
@@ -24,7 +23,9 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module
public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions)
{
- parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag());
+ parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag());
+
+ $this->setAttribute('index', $node->getAttribute('index'));
$this->usedFilters = $usedFilters;
$this->usedTags = $usedTags;
@@ -33,9 +34,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module
protected function compileDisplayBody(Twig_Compiler $compiler)
{
- if (null === $this->getNode('parent')) {
- $compiler->write("\$this->checkSecurity();\n");
- }
+ $compiler->write("\$this->checkSecurity();\n");
parent::compileDisplayBody($compiler);
}
@@ -45,7 +44,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module
parent::compileDisplayFooter($compiler);
$compiler
- ->write("protected function checkSecurity() {\n")
+ ->write("protected function checkSecurity()\n", "{\n")
->indent()
->write("\$this->env->getExtension('sandbox')->checkSecurity(\n")
->indent()
@@ -54,16 +53,6 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module
->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n")
->outdent()
->write(");\n")
- ;
-
- if (null !== $this->getNode('parent')) {
- $compiler
- ->raw("\n")
- ->write("\$this->parent->checkSecurity();\n")
- ;
- }
-
- $compiler
->outdent()
->write("}\n\n")
;