summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2012-10-24 03:05:22 -0700
committerSeth Mos <seth.mos@dds.nl>2012-10-24 03:05:22 -0700
commit8e2597c95c1ca938642c8518c0111c3f0b7abfec (patch)
tree254246e687117b7a0b7ee98b14e2c8cb4f949225
parent8d1a9e58c92837504e3fc167f9a08570145766db (diff)
parenta133c803a53a92ed888d11d85a902f9333f2ebda (diff)
downloadpfsense-8e2597c95c1ca938642c8518c0111c3f0b7abfec.zip
pfsense-8e2597c95c1ca938642c8518c0111c3f0b7abfec.tar.gz
Merge pull request #242 from phil-davis/master
Fix warning when no gateway groups
-rwxr-xr-xusr/local/www/firewall_rules_edit.php32
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");
+ }
}
}
}
OpenPOWER on IntegriCloud