Revision 5c88dacb
Added by Phillip Davis about 8 years ago
src/usr/local/www/system_gateways_edit.php | ||
---|---|---|
500 | 500 |
if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") { |
501 | 501 |
$i = 0; |
502 | 502 |
/* remove the default gateway bits for all gateways with the same address family */ |
503 |
foreach ($a_gateway_item as $gw) { |
|
504 |
if ($gateway['ipprotocol'] == $gw['ipprotocol']) { |
|
505 |
unset($config['gateways']['gateway_item'][$i]['defaultgw']); |
|
506 |
if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) { |
|
507 |
$reloadif = $gw['interface']; |
|
503 |
if (is_array($a_gateway_item)) { |
|
504 |
foreach ($a_gateway_item as $gw) { |
|
505 |
if ($gateway['ipprotocol'] == $gw['ipprotocol']) { |
|
506 |
unset($config['gateways']['gateway_item'][$i]['defaultgw']); |
|
507 |
if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) { |
|
508 |
$reloadif = $gw['interface']; |
|
509 |
} |
|
508 | 510 |
} |
511 |
$i++; |
|
509 | 512 |
} |
510 |
$i++; |
|
511 | 513 |
} |
512 | 514 |
$gateway['defaultgw'] = true; |
513 | 515 |
} |
Also available in: Unified diff
Issue #7659 foreach warning on adding gateway RELENG_2_3
Signed-off-by: Phil Davis <phil@jankaritech.com>