diff options
author | Cristian Feldman <vizvayu@gmail.com> | 2012-05-18 22:57:38 -0300 |
---|---|---|
committer | Cristian Feldman <vizvayu@gmail.com> | 2012-05-18 22:57:38 -0300 |
commit | 90f90934c07691298c7ef96c869ad93b349c2706 (patch) | |
tree | 914bcff9375fb3e6ab4cb56f6d107c8a5048cd17 /usr/local/www/firewall_nat_out_edit.php | |
parent | 1346306cf7bdc82d4f33b607e46452fe6efa691f (diff) | |
download | pfsense-90f90934c07691298c7ef96c869ad93b349c2706.zip pfsense-90f90934c07691298c7ef96c869ad93b349c2706.tar.gz |
Fix of bug #2374 "When entering values in firewall rules leading and
trailing spaces are not deleted"
Diffstat (limited to 'usr/local/www/firewall_nat_out_edit.php')
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index 2ef7210..62d0ecc 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -133,13 +133,26 @@ if ($_POST) { $protocol_uses_ports = in_array($_POST['protocol'], explode(" ", "any tcp udp tcp/udp")); + if ($_POST['source']) + $_POST['source'] = trim($_POST['source']); + if ($_POST['destination']) + $_POST['destination'] = trim($_POST['destination']); + if ($_POST['targetip']) + $_POST['targetip'] = trim($_POST['targetip']); + if ($_POST['sourceport']) + $_POST['sourceport'] = trim($_POST['sourceport']); + if ($_POST['dstport']) + $_POST['dstport'] = trim($_POST['dstport']); + if ($_POST['natport']) + $_POST['natport'] = trim($_POST['natport']); + if($protocol_uses_ports && $_POST['sourceport'] <> "" && !is_portoralias($_POST['sourceport'])) $input_errors[] = gettext("You must supply either a valid port or port alias for the source port entry."); - if($protocol_uses_ports and $_POST['dstport'] <> "" and !is_portoralias($_POST['dstport'])) + if($protocol_uses_ports && $_POST['dstport'] <> "" && !is_portoralias($_POST['dstport'])) $input_errors[] = gettext("You must supply either a valid port or port alias for the destination port entry."); - if($protocol_uses_ports and $_POST['natport'] <> "" and !is_port($_POST['natport']) and !isset($_POST['nonat'])) + if($protocol_uses_ports && $_POST['natport'] <> "" && !is_port($_POST['natport']) && !isset($_POST['nonat'])) $input_errors[] = gettext("You must supply a valid port for the nat port entry."); if ($_POST['source_type'] != "any") { |