From 8664d2c4e9ce10377f1df0b2a5dd759db43da748 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Fri, 16 Feb 2024 13:29:52 +1300 Subject: [PATCH] ENH Allow all valid true-like ini values --- src/Core/Cache/DefaultCacheFactory.php | 4 +++- src/Dev/DebugView.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Core/Cache/DefaultCacheFactory.php b/src/Core/Cache/DefaultCacheFactory.php index 9fe65dc72e4..b82d6f08a2b 100644 --- a/src/Core/Cache/DefaultCacheFactory.php +++ b/src/Core/Cache/DefaultCacheFactory.php @@ -106,7 +106,9 @@ protected function isAPCUSupported() static $apcuSupported = null; if (null === $apcuSupported) { // Need to check for CLI because Symfony won't: https://github.com/symfony/symfony/pull/25080 - $apcuSupported = Director::is_cli() ? ini_get('apc.enable_cli') && ApcuAdapter::isSupported() : ApcuAdapter::isSupported(); + $apcuSupported = Director::is_cli() + ? filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOL) && ApcuAdapter::isSupported() + : ApcuAdapter::isSupported(); } return $apcuSupported; } diff --git a/src/Dev/DebugView.php b/src/Dev/DebugView.php index 5c380a7bf6f..4e5c4bc87a5 100644 --- a/src/Dev/DebugView.php +++ b/src/Dev/DebugView.php @@ -216,7 +216,7 @@ public function renderError($httpRequest, $errno, $errstr, $errfile, $errline) { $errorType = isset(self::$error_types[$errno]) ? self::$error_types[$errno] : self::$unknown_error; $httpRequestEnt = htmlentities($httpRequest ?? '', ENT_COMPAT, 'UTF-8'); - if (ini_get('html_errors')) { + if (filter_var(ini_get('html_errors'), FILTER_VALIDATE_BOOL)) { $errstr = strip_tags($errstr ?? ''); } else { $errstr = Convert::raw2xml($errstr);