summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_edit.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-29 20:55:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-29 20:55:21 +0000
commitaa3400b8fb45657bf2c2a2df4371fcf335648e63 (patch)
tree405f6dd1871c732bca039680e68f5be8d6406ee4 /usr/local/www/firewall_nat_edit.php
parentfd6135414d4051c8ded6102c0d936164773c413a (diff)
downloadpfsense-aa3400b8fb45657bf2c2a2df4371fcf335648e63.zip
pfsense-aa3400b8fb45657bf2c2a2df4371fcf335648e63.tar.gz
MFC 8805
Fix protocol checking so that existing input validation works use endport as startport if specified w/out startport
Diffstat (limited to 'usr/local/www/firewall_nat_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_edit.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 0633d08..5263f28 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -75,14 +75,17 @@ if ($_POST) {
if (!$_POST['endport'])
$_POST['endport'] = $_POST['beginport'];
+ /* Make beginning port end port if not defined and endport is */
+ if (!$_POST['beginport'] && $_POST['endport'])
+ $_POST['beginport'] = $_POST['endport'];
unset($input_errors);
$pconfig = $_POST;
/* input validation */
- if($_POST['proto'] == "TCP" or $_POST['proto'] == "UDP" or $_POST['proto'] == "TCP/UDP") {
+ if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
$reqdfields = explode(" ", "interface proto beginport localip localbeginport");
- $reqdfieldsn = explode(",", "Interface,Protocol,Start port,NAT IP,Local port");
+ $reqdfieldsn = explode(",", "Interface,Protocol,Ext. start port,NAT IP,Local port");
} else {
$reqdfields = explode(" ", "interface proto localip");
$reqdfieldsn = explode(",", "Interface,Protocol,NAT IP");
@@ -95,7 +98,7 @@ if ($_POST) {
}
/* only validate the ports if the protocol is TCP, UDP or TCP/UDP */
- if($_POST['proto'] == "TCP" or $_POST['proto'] == "UDP" or $_POST['proto'] == "TCP/UDP") {
+ if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
if (($_POST['beginport'] && !is_ipaddroralias($_POST['beginport']) && !is_port($_POST['beginport']))) {
$input_errors[] = "The start port must be an integer between 1 and 65535.";
OpenPOWER on IntegriCloud