Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a9c17c3

Browse filesBrowse files
committed
feature #9365 prevent PHP from magically setting a 302 header (lsmith77)
This PR was merged into the master branch. Discussion ---------- prevent PHP from magically setting a 302 header | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | yes (for people relying on getting a magic 302 when setting a Location header) | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - this needs a test case .. but first let me know if you are ok with this change. see http://www.php.net/manual/en/function.header.php Commits ------- c140d4f prevent PHP from magically setting a 302 header, see http://www.php.net/manual/en/function.header.php
2 parents ca1cb27 + c140d4f commit a9c17c3
Copy full SHA for a9c17c3

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,12 @@ public function sendHeaders()
332332
}
333333

334334
// status
335-
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
335+
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
336336

337337
// headers
338338
foreach ($this->headers->allPreserveCase() as $name => $values) {
339339
foreach ($values as $value) {
340-
header($name.': '.$value, false);
340+
header($name.': '.$value, false, $this->statusCode);
341341
}
342342
}
343343

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.