aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/template/twig/environment.php4
-rw-r--r--phpBB/phpbb/template/twig/lexer.php5
2 files changed, 6 insertions, 3 deletions
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index f6d9b73178..0ba7a265e4 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -13,9 +13,6 @@
namespace phpbb\template\twig;
-use Twig_Lexer;
-use Twig_LexerInterface;
-
class environment extends \Twig_Environment
{
/** @var \phpbb\config\config */
@@ -79,6 +76,7 @@ class environment extends \Twig_Environment
if (null === $this->lexer)
{
$this->lexer = $this->container->get('template.twig.lexer');
+ $this->lexer->set_environment($this);
}
return $this->lexer;
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index c5dc7273ba..a7848738bb 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -15,6 +15,11 @@ namespace phpbb\template\twig;
class lexer extends \Twig_Lexer
{
+ public function set_environment(\Twig_Environment $env)
+ {
+ $this->env = $env;
+ }
+
public function tokenize($code, $filename = null)
{
// Our phpBB tags