From bb6833d5013facc058a70376362ad0b45409ff03 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 5 Aug 2019 16:51:32 +0200 Subject: [PATCH] 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 --- src/www/system_gateways.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/www/system_gateways.php b/src/www/system_gateways.php index a97bea2ff..50a3c9357 100644 --- a/src/www/system_gateways.php +++ b/src/www/system_gateways.php @@ -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