From 847ee236dc38982344ce68d149e48d676159651c Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 7 Jul 2024 11:47:10 +0900 Subject: [PATCH] fix: `spark phpini:check` may cause TypeError --- system/Security/CheckPhpIni.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/Security/CheckPhpIni.php b/system/Security/CheckPhpIni.php index 4cef565ad7d6..1e92cdc403aa 100644 --- a/system/Security/CheckPhpIni.php +++ b/system/Security/CheckPhpIni.php @@ -50,17 +50,17 @@ public static function run(bool $isCli = true) private static function outputForCli(array $output, array $thead, array $tbody): void { foreach ($output as $directive => $values) { - $current = $values['current']; + $current = $values['current'] ?? ''; $notRecommended = false; if ($values['recommended'] !== '') { - if ($values['recommended'] !== $values['current']) { + if ($values['recommended'] !== $current) { $notRecommended = true; } $current = $notRecommended - ? CLI::color($values['current'] === '' ? 'n/a' : $values['current'], 'red') - : $values['current']; + ? CLI::color($current === '' ? 'n/a' : $current, 'red') + : $current; } $directive = $notRecommended ? CLI::color($directive, 'red') : $directive;