summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_aliases_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-17 15:43:28 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-02-17 15:43:28 -0300
commitc00e6bd4c35656bce340b6561c0c2c4ac0d3efa7 (patch)
tree0a7f6bc8ed016cd9f173338c93a8e932bbfa4651 /usr/local/www/firewall_aliases_edit.php
parentbd942860594ecf3383ac39eb203ce3c73d4c59d2 (diff)
downloadpfsense-c00e6bd4c35656bce340b6561c0c2c4ac0d3efa7.zip
pfsense-c00e6bd4c35656bce340b6561c0c2c4ac0d3efa7.tar.gz
Help ticket #3449:
Improve data validation to avoid save a host/subnet or a IPv4 with invalid mask. The reported error is on javascript and only happen on IE8,but this fix will prevent the same issue happening in the future on a different browser.
Diffstat (limited to 'usr/local/www/firewall_aliases_edit.php')
-rwxr-xr-xusr/local/www/firewall_aliases_edit.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
index 417deb2..e5702f2 100755
--- a/usr/local/www/firewall_aliases_edit.php
+++ b/usr/local/www/firewall_aliases_edit.php
@@ -307,8 +307,12 @@ if ($_POST) {
$address = array_merge($address, $rangesubnets);
} else {
$tmpaddress = $_POST["address{$x}"];
- if(is_ipaddr($_POST["address{$x}"]) && $_POST["address_subnet{$x}"] <> "")
- $tmpaddress .= "/" . $_POST["address_subnet{$x}"];
+ if($_POST['type'] != "host" && is_ipaddr($_POST["address{$x}"]) && $_POST["address_subnet{$x}"] <> "") {
+ if (!is_subnet($_POST["address{$x}"] . "/" . $_POST["address_subnet{$x}"]))
+ $input_errors[] = sprintf(gettext('%s/%s is not a valid subnet.'), $_POST["address{$x}"], $_POST["address_subnet{$x}"]);
+ else
+ $tmpaddress .= "/" . $_POST["address_subnet{$x}"];
+ }
$address[] = $tmpaddress;
}
if ($_POST["detail{$x}"] <> "") {
OpenPOWER on IntegriCloud