Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Commit 5694f14

Browse files
committed
Fix ini_get() for boolean values
1 parent 11b1f30 commit 5694f14

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎Tests/ApcClassLoaderTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ApcClassLoaderTest extends TestCase
1919
{
2020
protected function setUp()
2121
{
22-
if (!(ini_get('apc.enabled')&& ini_get('apc.enable_cli'))) {
22+
if (!(filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) {
2323
$this->markTestSkipped('The apc extension is not enabled.');
2424
} else {
2525
apcu_clear_cache();
@@ -28,7 +28,7 @@ protected function setUp()
2828

2929
protected function tearDown()
3030
{
31-
if (ini_get('apc.enabled')&& ini_get('apc.enable_cli')) {
31+
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
3232
apcu_clear_cache();
3333
}
3434
}

‎Tests/LegacyApcUniversalClassLoaderTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
2121
{
2222
protected function setUp()
2323
{
24-
if (ini_get('apc.enabled')&& ini_get('apc.enable_cli')) {
24+
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
2525
apcu_clear_cache();
2626
} else {
2727
$this->markTestSkipped('APC is not enabled.');
@@ -30,7 +30,7 @@ protected function setUp()
3030

3131
protected function tearDown()
3232
{
33-
if (ini_get('apc.enabled')&& ini_get('apc.enable_cli')) {
33+
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
3434
apcu_clear_cache();
3535
}
3636
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /