8000 Change button_widget class to btn-primary by JulienMaille · Pull Request #29115 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Change button_widget class to btn-primary #29115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 8, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down
15 changes: 8 additions & 7 deletions src/Symfony/Component/Dotenv/Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -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_');
Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Dotenv/Tests/DotenvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/ParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
0