diff options
| author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-25 16:51:50 -0500 |
|---|---|---|
| committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-25 16:51:50 -0500 |
| commit | 1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e (patch) | |
| tree | 435b34f2bd489a5ce07d905e1d6e281e581b0af5 /phpBB/includes/template | |
| parent | 8bccba1a2fb5479ead0594b09dad95d4d22a5cec (diff) | |
| download | forums-1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e.tar forums-1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e.tar.gz forums-1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e.tar.bz2 forums-1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e.tar.xz forums-1c8c03c4dbd74f2f2abf6d2968bc33a234df5a4e.zip | |
[feature/twig] INCLUDEPHP token abs paths & fix test
PHPBB3-11598
Diffstat (limited to 'phpBB/includes/template')
| -rw-r--r-- | phpBB/includes/template/twig/node/includephp.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/includes/template/twig/node/includephp.php b/phpBB/includes/template/twig/node/includephp.php index 6e77fac55d..5315d136d7 100644 --- a/phpBB/includes/template/twig/node/includephp.php +++ b/phpBB/includes/template/twig/node/includephp.php @@ -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')) { |
