-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix ini_get() for boolean values #29020
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -19,7 +19,7 @@ class ApcClassLoaderTest extends TestCase | |||
{ | |||
protected function setUp() | |||
{ | |||
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) { | |||
if (!(\filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) && \filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove all the \
added in front of filter_var()
and FILTER_VALIDATE_BOOLEAN
in the PR?
We don't add these except for a specific short list of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, changed ;)
See also symfony/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php Lines 86 to 87 in 2cd1e11
|
oh wait.. i checked master :) AboutCommand would be for 3.4 |
Yes, will do another PR which will target 3.4 after ;) |
I'm also going to check every ini_get, I just focused on |
Cool :) i was curious if this applies to all boolean typed ini directives. I think it does 👍 https://3v4l.org/aYsiU |
Ok, just added
Not sure about |
Thank you @deguif. |
This PR was merged into the 2.8 branch. Discussion ---------- Fix ini_get() for boolean values | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Currently setting `false` or `off`, ... value to configure some PHP ini directives will make this evaluated to `true` as this is equal to a non empty string. Commits ------- a153869 Fix ini_get() for boolean values
This PR was merged into the 3.4 branch. Discussion ---------- Fix ini_get() for boolean values | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This follows #29020 for branch 3.4 Commits ------- 65b34cb Fix ini_get() for boolean values
Currently setting
false
oroff
, ... value to configure some PHP ini directives will make this evaluated totrue
as this is equal to a non empty string.