diff options
author | stilez <stilez@users.noreply.github.com> | 2016-09-10 08:01:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 08:01:18 +0100 |
commit | cff60fef4f41a775020b4929c97c039d747e9c31 (patch) | |
tree | 0677c4ad4e0e24fe0ad550bdd3aafc029339b1cf /src/usr | |
parent | 667fd2b7e2012ea1632fe302de20458f1bbc77d4 (diff) | |
download | pfsense-cff60fef4f41a775020b4929c97c039d747e9c31.zip pfsense-cff60fef4f41a775020b4929c97c039d747e9c31.tar.gz |
More redundant logic
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index fa5d549..52aa47e 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -322,16 +322,16 @@ if ($_POST) { } } } - } - if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "") && (is_ipaddr(lookup_gateway_ip_by_name($_POST['gateway'])))) { - if (($_POST['ipprotocol'] == "inet46") && ($_POST['gateway'] <> "")) { - $input_errors[] = gettext("A gateway can not be assigned to a rule that applies to IPv4 and IPv6"); - } - if (($_POST['ipprotocol'] == "inet6") && (!is_ipaddrv6(lookup_gateway_ip_by_name($_POST['gateway'])))) { - $input_errors[] = gettext("An IPv4 Gateway can not be assigned to an IPv6 Filter rule"); - } - if (($_POST['ipprotocol'] == "inet") && (!is_ipaddrv4(lookup_gateway_ip_by_name($_POST['gateway'])))) { - $input_errors[] = gettext("An IPv6 Gateway can not be assigned to an IPv4 Filter rule"); + if (is_ipaddr(lookup_gateway_ip_by_name($_POST['gateway']))) { + if (($_POST['ipprotocol'] == "inet46") && ($_POST['gateway'] <> "")) { + $input_errors[] = gettext("A gateway can not be assigned to a rule that applies to IPv4 and IPv6"); + } + if (($_POST['ipprotocol'] == "inet6") && (!is_ipaddrv6(lookup_gateway_ip_by_name($_POST['gateway'])))) { + $input_errors[] = gettext("An IPv4 Gateway can not be assigned to an IPv6 Filter rule"); + } + if (($_POST['ipprotocol'] == "inet") && (!is_ipaddrv4(lookup_gateway_ip_by_name($_POST['gateway'])))) { + $input_errors[] = gettext("An IPv6 Gateway can not be assigned to an IPv4 Filter rule"); + } } } if (($_POST['proto'] == "icmp") && ($_POST['icmptype'] <> "")) { |