diff options
author | Phil Davis <phil.davis@inf.org> | 2015-10-04 13:15:51 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-10-04 13:15:51 +0545 |
commit | 6c287b0ef8189d5d370191e9c80847c2ac07af32 (patch) | |
tree | 5831ff5643c656f8bfb2829f2fbfd1153d946f66 /src/usr/local/www/firewall_rules_edit.php | |
parent | d42b970ed8fb67491bfbbda0bd44e6d3fa0ab95f (diff) | |
download | pfsense-6c287b0ef8189d5d370191e9c80847c2ac07af32.zip pfsense-6c287b0ef8189d5d370191e9c80847c2ac07af32.tar.gz |
Fix #5252 Preserve alias when editing an existing rule
and default src and dst to any when creating a new rule.
Diffstat (limited to 'src/usr/local/www/firewall_rules_edit.php')
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index b3363b2..6f78b81 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1242,12 +1242,15 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { ))->setWidth(2); $ruleType = $pconfig[$type]; - if (is_specialnet($pconfig[$type])) + if ($pconfig[$type] == 'any') { + $ruleType = 'any'; + } elseif (is_specialnet($pconfig[$type])) { $ruleType = 'network'; - elseif ((is_ipaddrv6($pconfig[$type]) && $pconfig[$type.'mask'] == 128) || + } elseif ((is_ipaddrv6($pconfig[$type]) && $pconfig[$type.'mask'] == 128) || (is_ipaddrv4($pconfig[$type]) && $pconfig[$type.'mask'] == 32) || - (is_alias($pconfig[$type]))) + (is_alias($pconfig[$type]))) { $ruleType = 'single'; + } $ruleValues = array( 'any' => 'any', @@ -1273,7 +1276,8 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { $group->add(new Form_Select( $type . 'type', $name .' Type', - $type == 'src' ? $pconfig['src']:$pconfig['dst'], +// $type == 'src' ? $pconfig['src']:$pconfig['dst'], + $ruleType, $ruleValues )); |