[HttpFoundation] tweaked previous merge

This commit is contained in:
Fabien Potencier 2012-07-15 09:31:47 +02:00
parent 4513210276
commit d7a5449dda
1 changed files with 5 additions and 1 deletions

View File

@ -300,7 +300,11 @@ class Response
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
} else {
while (0 < ob_get_level()) {
// ob_get_level() never returns 0 on some Windows configurations, so if
// the level is the same two times in a row, the loop should be stopped.
$previous = null;
while (($level = ob_get_level()) > 0 && $level !== $previous) {
$previous = $level;
ob_end_flush();
}
flush();