diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-03-11 21:39:39 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-03-11 21:39:39 +0100 |
commit | 8b060357e806292c10e79ff7d7f01e6722c29975 (patch) | |
tree | 92136137d508f9131dd09133e155166bcaaf8b41 /usr/local/www/system_gateway_groups_edit.php | |
parent | 31ace93c7e6dcb7d3f388982c71ecb854f52f7ed (diff) | |
download | pfsense-8b060357e806292c10e79ff7d7f01e6722c29975.zip pfsense-8b060357e806292c10e79ff7d7f01e6722c29975.tar.gz |
Add input validation on the gateway groups page as well, fix the check on the gateways page.
Diffstat (limited to 'usr/local/www/system_gateway_groups_edit.php')
-rwxr-xr-x | usr/local/www/system_gateway_groups_edit.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index 60da1cb..cad6867 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -76,16 +76,21 @@ if ($_POST) { if (! isset($_POST['name'])) { $input_errors[] = "A valid gateway group name must be specified."; } + if (! is_validaliasname($_POST['name'])) { + $input_errors[] = "The gateway name must not contain invalid characters."; + } - /* check for overlaps */ - if(is_array($a_gateway_groups)) { - foreach ($a_gateway_groups as $gateway_group) { - if (isset($id) && ($a_gateway_groups[$id]) && ($a_gateway_groups[$id] === $gateway_group)) - continue; + if (isset($_POST['name'])) { + /* check for overlaps */ + if(is_array($a_gateway_groups)) { + foreach ($a_gateway_groups as $gateway_group) { + if (isset($id) && ($a_gateway_groups[$id]) && ($a_gateway_groups[$id] === $gateway_group)) + continue; - if ($gateway_group['name'] == $_POST['name']) { - $input_errors[] = "A gateway group with this name \"{$_POST['name']}\" already exists."; - break; + if ($gateway_group['name'] == $_POST['name']) { + $input_errors[] = "A gateway group with this name \"{$_POST['name']}\" already exists."; + break; + } } } } |