1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Merge pull request #4903 from rxu/ticket/15323

[ticket/15323] Allow Twig syntax in bbcode.html
This commit is contained in:
Máté Bartus
2017-09-07 15:08:12 +02:00
committed by GitHub
4 changed files with 102 additions and 7 deletions

View File

@@ -501,7 +501,10 @@ class bbcode
// Turn template blocks into PHP assignment statements for the values of $bbcode_tpl..
$this->bbcode_template = array();
$matches = preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END (?:.*?) -->#', $tpl, $match);
// Capture the BBCode template matches
// Allow phpBB template or the Twig syntax
$matches = (preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END (?:.*?) -->#', $tpl, $match)) ?:
preg_match_all('#{% for (.*?) in .*? %}(.*?){% endfor %}#s', $tpl, $match);
for ($i = 0; $i < $matches; $i++)
{