Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63c74f7

Browse files
Merge branch '2.8' into 3.4
* 2.8: Fixed typo Fix ini_get() for boolean values
2 parents 555f2d9 + 5a2969c commit 63c74f7

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

UPGRADE-3.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ UPGRADE FROM 2.x to 3.0
681681
As a value for the option you must provide the fully-qualified class name (FQCN)
682682
now as well.
683683

684-
* The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace.
684+
* The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved from the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace.
685685

686686
* The constants `ROUND_HALFEVEN`, `ROUND_HALFUP` and `ROUND_HALFDOWN` in class
687687
`NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,

src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php

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

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

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function write($content, array $metadata = null)
137137
}
138138
}
139139

140-
if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
140+
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
141141
@opcache_invalidate($this->file, true);
142142
}
143143
}

src/Symfony/Component/Debug/Debug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function enable($errorReportingLevel = E_ALL, $displayErrors = tru
4545
if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
4646
ini_set('display_errors', 0);
4747
ExceptionHandler::register();
48-
} elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
48+
} elseif ($displayErrors && (!filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN) || ini_get('error_log'))) {
4949
// CLI - display errors only if they're not already logged to STDERR
5050
ini_set('display_errors', 1);
5151
}

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function collect(Request $request, Response $response, \Exception $except
6868
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
6969
'php_timezone' => date_default_timezone_get(),
7070
'xdebug_enabled' => \extension_loaded('xdebug'),
71-
'apcu_enabled' => \extension_loaded('apcu') && ini_get('apc.enabled'),
72-
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
71+
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN),
72+
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN),
7373
'bundles' => array(),
7474
'sapi_name' => \PHP_SAPI,
7575
);

src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function testCollect()
3939
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
4040
$this->assertNull($c->getToken());
4141
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
42-
$this->assertSame(\extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache());
43-
$this->assertSame(\extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu());
42+
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)), $c->hasZendOpcache());
43+
$this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)), $c->hasApcu());
4444
}
4545
}
4646

0 commit comments

Comments
 (0)