aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/environment.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-25 00:31:13 +0100
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-25 00:31:45 +0100
commite91b1fa464c01d2ebf9fc9c732e8d2810223bc00 (patch)
treecc6f7839fae0c4c3a7d530226379cfcbc0c2926f /phpBB/phpbb/template/twig/environment.php
parent52b3d54805af6d0a89ede1cd2acac92cd95693c0 (diff)
downloadforums-e91b1fa464c01d2ebf9fc9c732e8d2810223bc00.tar
forums-e91b1fa464c01d2ebf9fc9c732e8d2810223bc00.tar.gz
forums-e91b1fa464c01d2ebf9fc9c732e8d2810223bc00.tar.bz2
forums-e91b1fa464c01d2ebf9fc9c732e8d2810223bc00.tar.xz
forums-e91b1fa464c01d2ebf9fc9c732e8d2810223bc00.zip
[ticket/13717] Fix tests
PHPBB3-13717
Diffstat (limited to 'phpBB/phpbb/template/twig/environment.php')
-rw-r--r--phpBB/phpbb/template/twig/environment.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index 709505a75f..5660ddc3a4 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -205,8 +205,23 @@ class environment extends \Twig_Environment
*/
public function display($name, array $context = [])
{
+ $level = ob_get_level();
ob_start();
- parent::display($name, $context);
+
+ try
+ {
+ parent::display($name, $context);
+ }
+ catch (\Exception $e)
+ {
+ while (ob_get_level() > $level)
+ {
+ ob_end_clean();
+ }
+
+ throw $e;
+ }
+
$output = ob_get_clean();
echo $this->inject_assets($output);