1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/twig] INCLUDEPHP token abs paths & fix test

PHPBB3-11598
This commit is contained in:
Nathaniel Guse
2013-06-25 16:51:50 -05:00
parent 8bccba1a2f
commit 1c8c03c4db
2 changed files with 15 additions and 12 deletions

View File

@@ -50,9 +50,17 @@ class phpbb_template_twig_node_includephp extends Twig_Node
$expr = preg_replace('#{{ ([a-zA-Z0-9_]+) }}#', '\' . ((isset($context["$1"])) ? $context["$1"] : null) . \'', $this->getNode('expr')->getAttribute('value'));
$compiler
->write("require(\$this->getEnvironment()->get_phpbb_root_path() . '")
->raw($expr)
->raw("');\n")
->write("if (phpbb_is_absolute('$expr')) {\n")
->indent()
->write("require('$expr');\n")
->outdent()
->write("} else {\n")
->indent()
->write("require(\$this->getEnvironment()->get_phpbb_root_path() . '")
->raw($expr)
->raw("');\n")
->outdent()
->write("}\n")
;
if ($this->getAttribute('ignore_missing')) {