diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-03-13 21:59:11 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-03-13 21:59:11 +0100 |
commit | 6c5334c716facdb4c72f36c66307c18622d17222 (patch) | |
tree | 898a2d8f139f8e2a37005af80efb0d63f7c21876 /usr/local/www/system_gateways_settings.php | |
parent | db7b006f39a507f2e4ceca17557b1db637f4611f (diff) | |
download | pfsense-6c5334c716facdb4c72f36c66307c18622d17222.zip pfsense-6c5334c716facdb4c72f36c66307c18622d17222.tar.gz |
Fix input validation
Fix page title
Diffstat (limited to 'usr/local/www/system_gateways_settings.php')
-rwxr-xr-x | usr/local/www/system_gateways_settings.php | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/usr/local/www/system_gateways_settings.php b/usr/local/www/system_gateways_settings.php index 35ef2fc..26a3c68 100755 --- a/usr/local/www/system_gateways_settings.php +++ b/usr/local/www/system_gateways_settings.php @@ -43,6 +43,7 @@ if (!is_array($config['gateways']['settings'])) $a_settings = &$config['gateways']['settings']; $changedesc = "Gateways: "; +$input_errors = array(); require("guiconfig.inc"); @@ -64,13 +65,42 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - if(($_POST['latencylow']) && ($_POST['latencylow'] > $_POST['latencyhigh'])) { - $inputerrors = "The High latency watermark needs to be higher then the low latency watermark"; + if($_POST['latencylow']) { + if (! is_numeric($_POST['latencylow'])) { + $input_errors[] = "The low latency watermark needs to be a numeric value."; + } } - if(($_POST['losslow']) && ($_POST['latencylow'] > $_POST['losshigh'])) { - $inputerrors = "The High packet loss watermark needs to be higher then the low packet loss watermark"; + + if($_POST['latencyhigh']) { + if (! is_numeric($_POST['latencyhigh'])) { + $input_errors[] = "The high latency watermark needs to be a numeric value."; + } + } + if($_POST['losslow']) { + if (! is_numeric($_POST['losslow'])) { + $input_errors[] = "The low loss watermark needs to be a numeric value."; + } + } + if($_POST['losshigh']) { + if (! is_numeric($_POST['losshigh'])) { + $input_errors[] = "The high loss watermark needs to be a numeric value."; + } + } + + if(($_POST['latencylow']) && ($_POST['latencyhigh'])){ + if(($_POST['latencylow'] > $_POST['latencyhigh'])) { + $input_errors[] = "The High latency watermark needs to be higher then the low latency watermark"; + } } + if(($_POST['losslow']) && ($_POST['losshigh'])){ + if($_POST['losslow'] > $_POST['losshigh']) { + $input_errors[] = "The High packet loss watermark needs to be higher then the low packet loss watermark"; + } + } + + + if (!$input_errors) { $a_settings['latencylow'] = $_POST['latencylow']; $a_settings['latencyhigh'] = $_POST['latencyhigh']; @@ -88,7 +118,7 @@ if ($_POST) { } } -$pgtitle = array("Status","RRD Graphs"); +$pgtitle = array("Gateways","Settings"); include("head.inc"); ?> |