diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-11-03 21:36:12 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-11-03 21:36:12 +0100 |
commit | 4d07f8a13423529d4559d6579f98305ee471ee84 (patch) | |
tree | 3fa97d37a3803e499a0d3c82bf3da6cff09a2975 /phpBB/phpbb/template/twig | |
parent | 094ac6b60fbe9e0d7e1042a919f7a5e5602a759a (diff) | |
download | forums-4d07f8a13423529d4559d6579f98305ee471ee84.tar forums-4d07f8a13423529d4559d6579f98305ee471ee84.tar.gz forums-4d07f8a13423529d4559d6579f98305ee471ee84.tar.bz2 forums-4d07f8a13423529d4559d6579f98305ee471ee84.tar.xz forums-4d07f8a13423529d4559d6579f98305ee471ee84.zip |
[ticket/14716] Update dependencies to latest versions
This addresses some issues with symfony that resulted in
issues when open_basedir restrictions were enabled, as well
as issues with JPEG images in fast-image-size.
The phpBB class extending the twig lexer also had to be
modified to ensure compatibility after BC was broken by
the PR https://github.com/twigphp/Twig/pull/2182 for twig
1.27.
PHPBB3-14716
Diffstat (limited to 'phpBB/phpbb/template/twig')
-rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index f1542109a4..de03aec04b 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -22,6 +22,11 @@ class lexer extends \Twig_Lexer public function tokenize($code, $filename = null) { + if ($code instanceof \Twig_Source) + { + $filename = $code->getName(); + $code = $code->getCode(); + } // Our phpBB tags // Commented out tokens are handled separately from the main replace $phpbb_tags = array( @@ -125,7 +130,7 @@ class lexer extends \Twig_Lexer // Appends any filters $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code); - return parent::tokenize($code, $filename); + return parent::tokenize(new \Twig_Source($code, $filename)); } /** |