Merge branch '2.8' into 3.4

* 2.8:
  [HttpFoundation] Fixed PHP doc of ParameterBag::getBoolean
  [HttpFoundation] replace any preexisting Content-Type headers
This commit is contained in:
Nicolas Grekas 2018-11-08 22:47:40 +01:00
commit a141ab0105
2 changed files with 3 additions and 2 deletions

View File

@ -174,7 +174,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
* Returns the parameter value converted to boolean. * Returns the parameter value converted to boolean.
* *
* @param string $key The parameter key * @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist * @param bool $default The default value if the parameter key does not exist
* *
* @return bool The filtered value * @return bool The filtered value
*/ */

View File

@ -334,8 +334,9 @@ class Response
// headers // headers
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
$replace = 0 === strcasecmp($name, 'Content-Type');
foreach ($values as $value) { foreach ($values as $value) {
header($name.': '.$value, false, $this->statusCode); header($name.': '.$value, $replace, $this->statusCode);
} }
} }