Skip to content

Commit 5dca5cc

Browse files
committed
Gateways, empty gateway_group tag in config.xml being parsed in getGroups() results. fix a bit of spacing while here. closes #3576
1 parent dd02e21 commit 5dca5cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,11 @@ public function getInterfaceGateway($interface, $ipproto = "inet")
389389
*/
390390
public function getGroups($status_info)
391391
{
392-
$all_gateways = $this->gatewaysIndexedByName();
393-
$result = array();
392+
$all_gateways = $this->gatewaysIndexedByName();
393+
$result = array();
394394
if (isset($this->configHandle->gateways)) {
395395
foreach ($this->configHandle->gateways->children() as $tag => $gw_group) {
396-
if ($tag == "gateway_group") {
396+
if ($tag == "gateway_group" && !empty($gw_group)) {
397397
$tiers = array();
398398
if (isset($gw_group->item)) {
399399
foreach ($gw_group->item as $item) {
@@ -453,7 +453,7 @@ public function getGroups($status_info)
453453
}
454454
}
455455
}
456-
return $result;
456+
return $result;
457457
}
458458

459459
/**

0 commit comments

Comments
 (0)