diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2017-06-11 16:44:15 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2017-06-11 16:44:15 +0200 |
| commit | c830af48bdc540617c4a287f42ee99cf7cf514d1 (patch) | |
| tree | ce32f05bffd341d3e14cadcd16303421719d9157 /phpBB/phpbb | |
| parent | 474cbe05743e66b1a997642200cca7ba3ebe519a (diff) | |
| parent | e2c0356f34bed706ca1dcf8fc0844109d764b935 (diff) | |
| download | forums-c830af48bdc540617c4a287f42ee99cf7cf514d1.tar forums-c830af48bdc540617c4a287f42ee99cf7cf514d1.tar.gz forums-c830af48bdc540617c4a287f42ee99cf7cf514d1.tar.bz2 forums-c830af48bdc540617c4a287f42ee99cf7cf514d1.tar.xz forums-c830af48bdc540617c4a287f42ee99cf7cf514d1.zip | |
Merge pull request #4799 from marc1706/ticket/15179
[ticket/15179] Update dependencies and fix compatibility with newer twig
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/console/command/update/check.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 11 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/loader.php | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/phpbb/console/command/update/check.php b/phpBB/phpbb/console/command/update/check.php index ed8ad79eea..9ced651e8b 100644 --- a/phpBB/phpbb/console/command/update/check.php +++ b/phpBB/phpbb/console/command/update/check.php @@ -325,7 +325,7 @@ class check extends \phpbb\console\command\command $io->table([ $this->language->lang('VERSION'), $this->language->lang('ANNOUNCEMENT_TOPIC'), - $this->language->lang('DOWNLOAD_LATEST'), + $this->language->lang('DOWNLOAD_LATEST'), ], $rows); } } diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index f1542109a4..d0bcfa615e 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -22,6 +22,14 @@ class lexer extends \Twig_Lexer public function tokenize($code, $filename = null) { + // Handle \Twig_Source format input + if ($code instanceof \Twig_Source) + { + $source = $code; + $code = $source->getCode(); + $filename = $source->getName(); + } + // Our phpBB tags // Commented out tokens are handled separately from the main replace $phpbb_tags = array( @@ -125,7 +133,8 @@ class lexer extends \Twig_Lexer // Appends any filters $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code); - return parent::tokenize($code, $filename); + // Tokenize \Twig_Source instance + return parent::tokenize(new \Twig_Source($code, $filename)); } /** diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index d2b42852ce..c13e3ee298 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -35,7 +35,7 @@ class loader extends \Twig_Loader_Filesystem { $this->filesystem = $filesystem; - parent::__construct($paths); + parent::__construct($paths, $this->filesystem->realpath(dirname(__FILE__))); } /** |
