diff options
| author | Máté Bartus <CHItA@users.noreply.github.com> | 2017-09-07 15:08:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-07 15:08:12 +0200 |
| commit | da357f80f859844bcf0323201045ca082b9d68e7 (patch) | |
| tree | ac124713422f2b58b29d07ffd603840c5da0fc1b /phpBB/includes/bbcode.php | |
| parent | 9af394eff3d3f571e8c8d82c4b2c10bc3de4accd (diff) | |
| parent | e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280 (diff) | |
| download | forums-da357f80f859844bcf0323201045ca082b9d68e7.tar forums-da357f80f859844bcf0323201045ca082b9d68e7.tar.gz forums-da357f80f859844bcf0323201045ca082b9d68e7.tar.bz2 forums-da357f80f859844bcf0323201045ca082b9d68e7.tar.xz forums-da357f80f859844bcf0323201045ca082b9d68e7.zip | |
Merge pull request #4903 from rxu/ticket/15323
[ticket/15323] Allow Twig syntax in bbcode.html
Diffstat (limited to 'phpBB/includes/bbcode.php')
| -rw-r--r-- | phpBB/includes/bbcode.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index e8492a82a3..6572c0ad2c 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -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++) { |
