From 518e21d0880b2891a13aec7fd4dcd5ded913d6a6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 30 Aug 2022 18:14:54 +0200 Subject: [PATCH] [HttpFoundation] move flushing outside of Response::closeOutputBuffers --- Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Response.php b/Response.php index c14a7bbfd..75f64fa9e 100644 --- a/Response.php +++ b/Response.php @@ -384,6 +384,7 @@ public function send() fastcgi_finish_request(); } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) { static::closeOutputBuffers(0, true); + flush(); } return $this; @@ -1236,7 +1237,6 @@ public static function closeOutputBuffers(int $targetLevel, bool $flush): void while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) { if ($flush) { ob_end_flush(); - flush(); } else { ob_end_clean(); }