mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Check if an item is an array before treating it as such in the upgrade code.
This commit is contained in:
parent
dfa766ffcc
commit
5962f766e9
@ -2455,9 +2455,9 @@ function upgrade_070_to_071() {
|
||||
function rename_field(& $section, $oldname, $newname) {
|
||||
if (is_array($section)) {
|
||||
foreach($section as & $item) {
|
||||
if (!empty($item[$oldname]))
|
||||
if (is_array($item) && !empty($item[$oldname]))
|
||||
$item[$newname] = $item[$oldname];
|
||||
if (isset($item[$oldname]))
|
||||
if (is_array($item) && isset($item[$oldname]))
|
||||
unset($item[$oldname]);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user