Gateways, minor overview cleanup. if all gateway_items are removed, we should remove the container to to prevent leaving an empty item. found while working on https://github.com/opnsense/core/issues/3625

This commit is contained in:
Ad Schellevis 2019-08-05 16:51:32 +02:00
parent 74ff64787c
commit bb6833d501

View File

@ -105,6 +105,10 @@ function delete_gateway_item($id, $a_gateways)
}
}
unset($config['gateways']['gateway_item'][$a_gateways[$id]['attribute']]);
if (empty($config['gateways']['gateway_item'])) {
// make sure we don't leave a stray gateway_item
unset($config['gateways']['gateway_item']);
}
}
// fetch gateway list including active default for IPv4/IPv6