Skip to content

Commit 971b0da

Browse files
authored
Merge pull request #8804 from kenjis/fix-phpini-check-Undefined-array-key
fix: [ErrorException] Undefined array key in `spark phpini:check`
2 parents 6934848 + 8d51433 commit 971b0da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system/Security/CheckPhpIni.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ public static function checkIni(): array
141141
$ini = ini_get_all();
142142

143143
foreach ($items as $key => $values) {
144+
$hasKeyInIni = array_key_exists($key, $ini);
144145
$output[$key] = [
145-
'global' => $ini[$key]['global_value'],
146-
'current' => $ini[$key]['local_value'],
146+
'global' => $hasKeyInIni ? $ini[$key]['global_value'] : 'disabled',
147+
'current' => $hasKeyInIni ? $ini[$key]['local_value'] : 'disabled',
147148
'recommended' => $values['recommended'] ?? '',
148149
'remark' => $values['remark'] ?? '',
149150
];

0 commit comments

Comments
 (0)