From 92fc14e2e523e2c314868fd861a80d0a25bd7549 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 16 Jul 2012 14:40:38 +0000 Subject: Add input validation --- config/snort/snort_define_servers.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/snort/snort_define_servers.php b/config/snort/snort_define_servers.php index ef06039d..50342e0a 100644 --- a/config/snort/snort_define_servers.php +++ b/config/snort/snort_define_servers.php @@ -96,6 +96,14 @@ if ($_POST) { $natent = array(); $natent = $pconfig; + foreach ($snort_servers as $key => $server) { + if ($_POST["def_{$key}"] && !is_alias($_POST["def_{$key}"])) + $input_errors[] = "Only aliases are allowed"; + } + foreach ($snort_ports as $key => $server) { + if ($_POST["def_{$key}"] && !is_alias($_POST["def_{$key}"])) + $input_errors[] = "Only aliases are allowed"; + } /* if no errors write to conf */ if (!$input_errors) { /* post new options */ -- cgit v1.2.3