[FrameworkBundle] added a safeguard for infinite loops on some Windows configurations

This commit is contained in:
Fabien Potencier 2011-01-31 08:54:05 +01:00
parent 839cb027a6
commit 1babf3c7a1

View File

@ -36,8 +36,12 @@ class ExceptionController extends ContainerAware
{
$this->container->get('request')->setRequestFormat($format);
// the count variable avoids an infinite loop on
// some Windows configurations where ob_get_level()
// never reaches 0
$count = 100;
$currentContent = '';
while (ob_get_level()) {
while (ob_get_level() && --$count) {
$currentContent .= ob_get_clean();
}