diff options
author | Seth Mos <seth.mos@dds.nl> | 2012-10-24 03:05:22 -0700 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2012-10-24 03:05:22 -0700 |
commit | 8e2597c95c1ca938642c8518c0111c3f0b7abfec (patch) | |
tree | 254246e687117b7a0b7ee98b14e2c8cb4f949225 | |
parent | 8d1a9e58c92837504e3fc167f9a08570145766db (diff) | |
parent | a133c803a53a92ed888d11d85a902f9333f2ebda (diff) | |
download | pfsense-8e2597c95c1ca938642c8518c0111c3f0b7abfec.zip pfsense-8e2597c95c1ca938642c8518c0111c3f0b7abfec.tar.gz |
Merge pull request #242 from phil-davis/master
Fix warning when no gateway groups
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index d46c9f0..119d347 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -184,7 +184,7 @@ if (isset($id) && $a_filter[$id]) { $pconfig['src'] = "any"; $pconfig['dst'] = "any"; } -/* Allow the FlotingRules to work */ +/* Allow the FloatingRules to work */ $if = $pconfig['interface']; if (isset($_GET['dup'])) @@ -211,20 +211,22 @@ if ($_POST) { if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "")) { $a_gatewaygroups = return_gateway_groups_array(); - foreach($config['gateways']['gateway_group'] as $gw_group) { - if($gw_group['name'] == $_POST['gateway']) { - $family = $a_gatewaygroups[$_POST['gateway']]['ipprotocol']; - if($_POST['ipprotocol'] == $family) { - continue; - } - if(($_POST['ipprotocol'] == "inet46") && ($_POST['ipprotocol'] != $family)) { - $input_errors[] = gettext("You can not assign a gateway to a rule that applies to IPv4 and IPv6"); - } - if(($_POST['ipprotocol'] == "inet6") && ($_POST['ipprotocol'] != $family)) { - $input_errors[] = gettext("You can not assign a IPv4 gateway group on IPv6 Address Family rule"); - } - if(($_POST['ipprotocol'] == "inet") && ($_POST['ipprotocol'] != $family)) { - $input_errors[] = gettext("You can not assign a IPv6 gateway group on IPv4 Address Family rule"); + if(is_array($config['gateways']['gateway_group'])) { + foreach($config['gateways']['gateway_group'] as $gw_group) { + if($gw_group['name'] == $_POST['gateway']) { + $family = $a_gatewaygroups[$_POST['gateway']]['ipprotocol']; + if($_POST['ipprotocol'] == $family) { + continue; + } + if(($_POST['ipprotocol'] == "inet46") && ($_POST['ipprotocol'] != $family)) { + $input_errors[] = gettext("You can not assign a gateway to a rule that applies to IPv4 and IPv6"); + } + if(($_POST['ipprotocol'] == "inet6") && ($_POST['ipprotocol'] != $family)) { + $input_errors[] = gettext("You can not assign a IPv4 gateway group on IPv6 Address Family rule"); + } + if(($_POST['ipprotocol'] == "inet") && ($_POST['ipprotocol'] != $family)) { + $input_errors[] = gettext("You can not assign a IPv6 gateway group on IPv4 Address Family rule"); + } } } } |