소스 검색

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

Fabien Potencier 14 년 전
부모
커밋
1babf3c7a1
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php

+ 5 - 1
src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php

@@ -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();
         }