diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index b4e5b0120eebf..8c6414895b88c 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -137,6 +137,11 @@ {{- parent() -}} {%- endblock button_widget %} +{% block submit_widget -%} + {%- set attr = attr|merge({class: (attr.class|default('btn-primary'))|trim}) -%} + {{- parent() -}} +{%- endblock submit_widget %} + {% block checkbox_widget -%} {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%} {%- if 'checkbox-custom' in parent_label_class -%} diff --git a/src/Symfony/Component/Dotenv/Dotenv.php b/src/Symfony/Component/Dotenv/Dotenv.php index 41b83f57a64d1..025206326a8bb 100644 --- a/src/Symfony/Component/Dotenv/Dotenv.php +++ b/src/Symfony/Component/Dotenv/Dotenv.php @@ -66,8 +66,8 @@ public function load($path/*, ...$paths*/) */ public function populate($values) { - $loadedVars = array_flip(explode(',', getenv('SYMFONY_DOTENV_VARS'))); - unset($loadedVars['']); + $updateLoadedVars = false; + $loadedVars = array_flip(explode(',', isset($_SERVER['SYMFONY_DOTENV_VARS']) ? $_SERVER['SYMFONY_DOTENV_VARS'] : (isset($_ENV['SYMFONY_DOTENV_VARS']) ? $_ENV['SYMFONY_DOTENV_VARS'] : ''))); foreach ($values as $name => $value) { $notHttpName = 0 !== strpos($name, 'HTTP_'); @@ -82,14 +82,15 @@ public function populate($values) $_SERVER[$name] = $value; } - $loadedVars[$name] = true; + if (!isset($loadedVars[$name])) { + $loadedVars[$name] = $updateLoadedVars = true; + } } - if ($loadedVars) { + if ($updateLoadedVars) { + unset($loadedVars['']); $loadedVars = implode(',', array_keys($loadedVars)); - putenv("SYMFONY_DOTENV_VARS=$loadedVars"); - $_ENV['SYMFONY_DOTENV_VARS'] = $loadedVars; - $_SERVER['SYMFONY_DOTENV_VARS'] = $loadedVars; + putenv('SYMFONY_DOTENV_VARS='.$_ENV['SYMFONY_DOTENV_VARS'] = $_SERVER['SYMFONY_DOTENV_VARS'] = $loadedVars); } } diff --git a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php index 7caa75f06622b..4492c8e9e08e0 100644 --- a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php +++ b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php @@ -268,7 +268,7 @@ public function testMemorizingLoadedVarsNamesInSpecialVar() public function testOverridingEnvVarsWithNamesMemorizedInSpecialVar() { - putenv('SYMFONY_DOTENV_VARS=FOO,BAR,BAZ'); + putenv('SYMFONY_DOTENV_VARS='.$_SERVER['SYMFONY_DOTENV_VARS'] = 'FOO,BAR,BAZ'); putenv('FOO=foo'); putenv('BAR=bar'); diff --git a/src/Symfony/Component/HttpFoundation/ParameterBag.php b/src/Symfony/Component/HttpFoundation/ParameterBag.php index e3be0a9b8b22a..19d7ee913a253 100644 --- a/src/Symfony/Component/HttpFoundation/ParameterBag.php +++ b/src/Symfony/Component/HttpFoundation/ParameterBag.php @@ -174,7 +174,7 @@ public function getInt($key, $default = 0) * Returns the parameter value converted to boolean. * * @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 */ diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 832260a51e5e8..f267d1e0e0fcc 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -334,8 +334,9 @@ public function sendHeaders() // headers foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { + $replace = 0 === strcasecmp($name, 'Content-Type'); foreach ($values as $value) { - header($name.': '.$value, false, $this->statusCode); + header($name.': '.$value, $replace, $this->statusCode); } }