aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2016-11-14 21:23:58 +0100
committerTristan Darricau <github@nicofuma.fr>2016-11-14 21:23:58 +0100
commitda428b1fd3166cd45b4b85a17ab22df71e541578 (patch)
tree74d8dc746fac8aa8dd6013fc1d5e6a4249b56981 /phpBB/phpbb/template
parentedaa36205fd81c3fcc07149f3d9b864e12c149c3 (diff)
parent4d07f8a13423529d4559d6579f98305ee471ee84 (diff)
downloadforums-da428b1fd3166cd45b4b85a17ab22df71e541578.tar
forums-da428b1fd3166cd45b4b85a17ab22df71e541578.tar.gz
forums-da428b1fd3166cd45b4b85a17ab22df71e541578.tar.bz2
forums-da428b1fd3166cd45b4b85a17ab22df71e541578.tar.xz
forums-da428b1fd3166cd45b4b85a17ab22df71e541578.zip
Merge pull request #4501 from marc1706/ticket/14716
[ticket/14716] Update dependencies to latest versions * marc1706/ticket/14716: [ticket/14716] Update dependencies to latest versions
Diffstat (limited to 'phpBB/phpbb/template')
-rw-r--r--phpBB/phpbb/template/twig/lexer.php7
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));
}
/**