aboutsummaryrefslogtreecommitdiffstats
path: root/config/dansguardian/dansguardian.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/dansguardian/dansguardian.inc')
-rwxr-xr-xconfig/dansguardian/dansguardian.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc
index 1c079fe7..3708e98c 100755
--- a/config/dansguardian/dansguardian.inc
+++ b/config/dansguardian/dansguardian.inc
@@ -964,10 +964,13 @@ EOF;
function dansguardian_validate_input($post, &$input_errors) {
foreach ($post as $key => $value) {
- if ($key == "name" && $value == "")
+ if (preg_match("/^(name|description)$/",$key) && $value == "")
$input_errors[] = "{$key} could not be empty.";
- else if ($key == "name" && $value=="sample")
+ else if ($key == "name" && $value=="sample")
$input_errors[] = "{$value} cannot be used as name.";
+ else if ($key == "name" && preg_match("/\W/",$value))
+ $input_errors[] = "{$value} cannot be used as name. Use only a-z 0-9 characters";
+
}
}