Skip to content

Commit 0ed0c41

Browse files
Merge branch '2.8' into 3.4
* 2.8: [HttpFoundation] Fixed PHP doc of ParameterBag::getBoolean [HttpFoundation] replace any preexisting Content-Type headers
2 parents 2eb00ea + de165b3 commit 0ed0c41

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ParameterBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function getInt($key, $default = 0)
174174
* Returns the parameter value converted to boolean.
175175
*
176176
* @param string $key The parameter key
177-
* @param mixed $default The default value if the parameter key does not exist
177+
* @param bool $default The default value if the parameter key does not exist
178178
*
179179
* @return bool The filtered value
180180
*/

Response.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ public function sendHeaders()
334334

335335
// headers
336336
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
337+
$replace = 0 === strcasecmp($name, 'Content-Type');
337338
foreach ($values as $value) {
338-
header($name.': '.$value, false, $this->statusCode);
339+
header($name.': '.$value, $replace, $this->statusCode);
339340
}
340341
}
341342

0 commit comments

Comments
 (0)