diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-02-17 15:43:28 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-02-17 15:45:28 -0300 |
commit | 18b4e253a92e1547974e9f3bbb86bc81b3c0e820 (patch) | |
tree | a3f78b21c6519a33de65c26facfd5d7251e6c4bf /usr/local/www | |
parent | d78a548c6d4b7e87763770b8dff7a200a3280a87 (diff) | |
download | pfsense-18b4e253a92e1547974e9f3bbb86bc81b3c0e820.zip pfsense-18b4e253a92e1547974e9f3bbb86bc81b3c0e820.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')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 8 |
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 a66605b..6326153 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -305,8 +305,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}"] <> "") |