From: Fabien Potencier Date: Mon, 31 Jan 2011 07:47:08 +0000 (+0100) Subject: fixes an infinite loop on some Windows configurations X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=4e6011d1ac57c408024b6d29f46297c4504bddbf;p=web%2Fkonrad%2Ftwig.git fixes an infinite loop on some Windows configurations --- diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index d4e1d74..e53cf96 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -169,7 +169,11 @@ abstract class Twig_Template implements Twig_TemplateInterface try { $this->display($context); } catch (Exception $e) { - while (ob_get_level()) { + // 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) { ob_end_clean(); }