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_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_edit.php')
-rwxr-xr-x | usr/local/www/firewall_nat_edit.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index ad91112..b50967b 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -113,9 +113,9 @@ if ($_POST) { if(strtoupper($_POST['proto']) == "TCP" || strtoupper($_POST['proto']) == "UDP" || strtoupper($_POST['proto']) == "TCP/UDP") { if ($_POST['srcbeginport_cust'] && !$_POST['srcbeginport']) - $_POST['srcbeginport'] = $_POST['srcbeginport_cust']; + $_POST['srcbeginport'] = trim($_POST['srcbeginport_cust']); if ($_POST['srcendport_cust'] && !$_POST['srcendport']) - $_POST['srcendport'] = $_POST['srcendport_cust']; + $_POST['srcendport'] = trim($_POST['srcendport_cust']); if ($_POST['srcbeginport'] == "any") { $_POST['srcbeginport'] = 0; @@ -128,9 +128,9 @@ if ($_POST) { $_POST['srcendport'] = $_POST['srcbeginport']; if ($_POST['dstbeginport_cust'] && !$_POST['dstbeginport']) - $_POST['dstbeginport'] = $_POST['dstbeginport_cust']; + $_POST['dstbeginport'] = trim($_POST['dstbeginport_cust']); if ($_POST['dstendport_cust'] && !$_POST['dstendport']) - $_POST['dstendport'] = $_POST['dstendport_cust']; + $_POST['dstendport'] = trim($_POST['dstendport_cust']); if ($_POST['dstbeginport'] == "any") { $_POST['dstbeginport'] = 0; @@ -143,7 +143,7 @@ if ($_POST) { $_POST['dstendport'] = $_POST['dstbeginport']; if ($_POST['localbeginport_cust'] && !$_POST['localbeginport']) - $_POST['localbeginport'] = $_POST['localbeginport_cust']; + $_POST['localbeginport'] = trim($_POST['localbeginport_cust']); /* Make beginning port end port if not defined and endport is */ if (!$_POST['srcbeginport'] && $_POST['srcendport']) @@ -209,6 +209,13 @@ if ($_POST) { $_POST['dstendport'] = 0; } + if ($_POST['src']) + $_POST['src'] = trim($_POST['src']); + if ($_POST['dst']) + $_POST['dst'] = trim($_POST['dst']); + if ($_POST['localip']) + $_POST['localip'] = trim($_POST['localip']); + if (!isset($_POST['nordr']) && ($_POST['localip'] && !is_ipaddroralias($_POST['localip']))) { $input_errors[] = sprintf(gettext("\"%s\" is not a valid redirect target IP address or host alias."), $_POST['localip']); } |