Skip to content

Commit ecb09ea

Browse files
bug #60875 [HttpFoundation] Revert " Emit PHP warning when Response::sendHeaders() is called while output has already been sent" (nicolas-grekas)
This PR was merged into the 7.3 branch. Discussion ---------- [HttpFoundation] Revert " Emit PHP warning when `Response::sendHeaders()` is called while output has already been sent" | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60603 | License | MIT This reverts commit cf554e1, reversing changes made to 392d0c9. Let's revert as this change is too disruptive for a minor version (and I'm also going to replace this by a deprecation on 7.4 so that we can throw the warning in 8.0) Commits ------- 51985c9 Revert "minor #60377 [HttpFoundation] Emit PHP warning when `Response::sendHeaders()` is called while output has already been sent (ivo95v)"
2 parents 1714f71 + 51985c9 commit ecb09ea

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,6 @@ public function sendHeaders(?int $statusCode = null): static
317317
{
318318
// headers have already been sent by the developer
319319
if (headers_sent()) {
320-
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
321-
$statusCode ??= $this->statusCode;
322-
header(\sprintf('HTTP/%s %s %s', $this->version, $statusCode, $this->statusText), true, $statusCode);
323-
}
324-
325320
return $this;
326321
}
327322

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy