diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-01 12:23:25 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-01 12:23:25 -0500 |
commit | e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07 (patch) | |
tree | e1ee1d735db00a73f353a8135d992d77180f458f /phpBB/includes | |
parent | 1b2e5503ac770c1825664507cd4b9407d177a2d9 (diff) | |
download | forums-e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07.tar forums-e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07.tar.gz forums-e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07.tar.bz2 forums-e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07.tar.xz forums-e9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07.zip |
[feature/twig] Fix includephp node
PHPBB3-11598
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/template/twig/node/includephp.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/phpBB/includes/template/twig/node/includephp.php b/phpBB/includes/template/twig/node/includephp.php index 5315d136d7..33142bf05a 100644 --- a/phpBB/includes/template/twig/node/includephp.php +++ b/phpBB/includes/template/twig/node/includephp.php @@ -46,19 +46,17 @@ class phpbb_template_twig_node_includephp extends Twig_Node ; } - // Replace variables in the expression - $expr = preg_replace('#{{ ([a-zA-Z0-9_]+) }}#', '\' . ((isset($context["$1"])) ? $context["$1"] : null) . \'', $this->getNode('expr')->getAttribute('value')); - $compiler - ->write("if (phpbb_is_absolute('$expr')) {\n") + ->write("\$location = ") + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ->write("if (phpbb_is_absolute(\$location)) {\n") ->indent() - ->write("require('$expr');\n") + ->write("require(\$location);\n") ->outdent() ->write("} else {\n") ->indent() - ->write("require(\$this->getEnvironment()->get_phpbb_root_path() . '") - ->raw($expr) - ->raw("');\n") + ->write("require(\$this->getEnvironment()->get_phpbb_root_path() . \$location);\n") ->outdent() ->write("}\n") ; |