From 5dca5cc7238a84a8611becbc48623c8e4646367a Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 17 Jul 2019 15:16:37 +0200 Subject: [PATCH] Gateways, empty gateway_group tag in config.xml being parsed in getGroups() results. fix a bit of spacing while here. closes https://github.com/opnsense/core/issues/3576 --- .../mvc/app/library/OPNsense/Routing/Gateways.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php index 65f3d848d..007fe0b18 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php +++ b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php @@ -389,11 +389,11 @@ class Gateways */ public function getGroups($status_info) { - $all_gateways = $this->gatewaysIndexedByName(); - $result = array(); + $all_gateways = $this->gatewaysIndexedByName(); + $result = array(); if (isset($this->configHandle->gateways)) { foreach ($this->configHandle->gateways->children() as $tag => $gw_group) { - if ($tag == "gateway_group") { + if ($tag == "gateway_group" && !empty($gw_group)) { $tiers = array(); if (isset($gw_group->item)) { foreach ($gw_group->item as $item) { @@ -453,7 +453,7 @@ class Gateways } } } - return $result; + return $result; } /**