diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 9ec4987b3b..5d36e2675a 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -681,7 +681,7 @@ UPGRADE FROM 2.x to 3.0 As a value for the option you must provide the fully-qualified class name (FQCN) now as well. - * The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace. + * The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved from the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace. * The constants `ROUND_HALFEVEN`, `ROUND_HALFUP` and `ROUND_HALFDOWN` in class `NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`, diff --git a/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php index ec5066803d..70896f3136 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php @@ -22,7 +22,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))) { $this->markTestSkipped('The apc extension is not enabled.'); } else { apcu_clear_cache(); @@ -31,7 +31,7 @@ class ApcClassLoaderTest extends TestCase protected function tearDown() { - 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)) { apcu_clear_cache(); } } diff --git a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php index 87e2c5d9f0..91feed6228 100644 --- a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php +++ b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php @@ -137,7 +137,7 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface } } - if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) { + if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { @opcache_invalidate($this->file, true); } } diff --git a/src/Symfony/Component/Debug/Debug.php b/src/Symfony/Component/Debug/Debug.php index c296d0f65a..2a3d7f3159 100644 --- a/src/Symfony/Component/Debug/Debug.php +++ b/src/Symfony/Component/Debug/Debug.php @@ -45,7 +45,7 @@ class Debug if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) { ini_set('display_errors', 0); ExceptionHandler::register(); - } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { + } elseif ($displayErrors && (!filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN) || ini_get('error_log'))) { // CLI - display errors only if they're not already logged to STDERR ini_set('display_errors', 1); } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php index 07eac4023e..abfd939f5f 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -68,8 +68,8 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte 'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', 'php_timezone' => date_default_timezone_get(), 'xdebug_enabled' => \extension_loaded('xdebug'), - 'apcu_enabled' => \extension_loaded('apcu') && ini_get('apc.enabled'), - 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && ini_get('opcache.enable'), + 'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN), + 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), 'bundles' => array(), 'sapi_name' => \PHP_SAPI, ); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php index a99e34ad42..ed614357e1 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -39,8 +39,8 @@ class ConfigDataCollectorTest extends TestCase $this->assertSame(Kernel::VERSION, $c->getSymfonyVersion()); $this->assertNull($c->getToken()); $this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug()); - $this->assertSame(\extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache()); - $this->assertSame(\extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu()); + $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)), $c->hasZendOpcache()); + $this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)), $c->hasApcu()); } }