diff options
author | Phil Davis <phil@jankaritech.com> | 2017-06-25 08:05:49 +0545 |
---|---|---|
committer | Phil Davis <phil@jankaritech.com> | 2017-06-25 08:27:05 +0545 |
commit | 5c88dacbc259c668899d8127e9ad1ec74d12e565 (patch) | |
tree | ed20a1ced14659e2b295d71c68a28e3c33356c5f | |
parent | e7908ab5ceb775daa3dbc17778152a7262e6e661 (diff) | |
download | pfsense-5c88dacbc259c668899d8127e9ad1ec74d12e565.zip pfsense-5c88dacbc259c668899d8127e9ad1ec74d12e565.tar.gz |
Issue #7659 foreach warning on adding gateway RELENG_2_3
Signed-off-by: Phil Davis <phil@jankaritech.com>
-rw-r--r-- | src/usr/local/www/system_gateways_edit.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php index 85e0afd..46238b1 100644 --- a/src/usr/local/www/system_gateways_edit.php +++ b/src/usr/local/www/system_gateways_edit.php @@ -500,14 +500,16 @@ if ($_POST) { if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") { $i = 0; /* remove the default gateway bits for all gateways with the same address family */ - foreach ($a_gateway_item as $gw) { - if ($gateway['ipprotocol'] == $gw['ipprotocol']) { - unset($config['gateways']['gateway_item'][$i]['defaultgw']); - if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) { - $reloadif = $gw['interface']; + if (is_array($a_gateway_item)) { + foreach ($a_gateway_item as $gw) { + if ($gateway['ipprotocol'] == $gw['ipprotocol']) { + unset($config['gateways']['gateway_item'][$i]['defaultgw']); + if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) { + $reloadif = $gw['interface']; + } } + $i++; } - $i++; } $gateway['defaultgw'] = true; } |