diff options
author | stilez <stilez@users.noreply.github.com> | 2016-09-11 03:20:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-11 03:20:38 +0100 |
commit | 58325912c8d1e16521c2d6f534e3497ddc37e86c (patch) | |
tree | 6f2ab5dcc56acf6fc40216de7a1a0708e466afc1 /src | |
parent | e23a417300bd01e86e30e8db6e7b29a18a766047 (diff) | |
download | pfsense-58325912c8d1e16521c2d6f534e3497ddc37e86c.zip pfsense-58325912c8d1e16521c2d6f534e3497ddc37e86c.tar.gz |
Simplify another loop
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 963f578..330191d 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -305,18 +305,12 @@ if ($_POST) { if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "")) { 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)) { + if ($gw_group['name'] == $_POST['gateway'] && $_POST['ipprotocol'] != $a_gatewaygroups[$_POST['gateway']]['ipprotocol']) { + if ($_POST['ipprotocol'] == "inet46") { $input_errors[] = gettext("Gateways can not be assigned in a rule that applies to both IPv4 and IPv6."); - } - if (($_POST['ipprotocol'] == "inet6") && ($_POST['ipprotocol'] != $family)) { + } elseif ($_POST['ipprotocol'] == "inet6") { $input_errors[] = gettext("An IPv4 gateway group can not be assigned in IPv6 rules."); - } - if (($_POST['ipprotocol'] == "inet") && ($_POST['ipprotocol'] != $family)) { + } elseif ($_POST['ipprotocol'] == "inet") { $input_errors[] = gettext("An IPv6 gateway group can not be assigned in IPv4 rules."); } } |