Skip to content

List which values are true for %env(bool:xxx)% #13783

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 1 commit into from
Jun 19, 2020

Conversation

SimonHeimberg
Copy link
Contributor

This is the behaviour since 4.2.
Before all strings except '', 'false', 'off' and 'no' were true as well.

This is the behaviour since [4.2](symfony/symfony@ce53261).
Before all strings except `''`, `'false'`, `'off'` and `'no'` were true as well.
@SimonHeimberg
Copy link
Contributor Author

I had to change my config when updating from 3.4 to 4.4, after having found what has changed. Maybe this helps somebody else to avoid it.

@maxhelias
Copy link
Contributor

Or otherwise cited the php documentation on the filter: https://www.php.net/manual/en/filter.filters.validate.php instead of repeating it

@javiereguiluz
Copy link
Member

@maxhelias good suggestion! I was going to do that ... but I checked the source code of "bool" processor ... and it's more complex than that: return (bool) (filter_var($env, FILTER_VALIDATE_BOOLEAN) ?: filter_var($env, FILTER_VALIDATE_INT) ?: filter_var($env, FILTER_VALIDATE_FLOAT)); The contents of this PR are the most accurate description of that code, so let's merge it.

@javiereguiluz
Copy link
Member

Thank you Simon.

@javiereguiluz javiereguiluz merged commit aad154b into symfony:4.4 Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants