From 681d2b8b7f9cbdc1b98390364e6f2baa76d2ddd9 Mon Sep 17 00:00:00 2001 From: Matthieu Robin Date: Fri, 1 Jul 2011 10:35:24 +0200 Subject: [PATCH] fix nested buffers issue #374 --- lib/Twig/Template.php | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 lib/Twig/Template.php diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php old mode 100644 new mode 100755 index aaef78a..a9580e1 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -192,15 +192,12 @@ abstract class Twig_Template implements Twig_TemplateInterface */ public function render(array $context) { + $level = ob_get_level(); ob_start(); try { $this->display($context); } catch (Exception $e) { - // the count variable avoids an infinite loop on - // some Windows configurations where ob_get_level() - // never reaches 0 - $count = 100; - while (ob_get_level() && --$count) { + while (ob_get_level() > $level) { ob_end_clean(); } -- 1.7.2.5