From 3c7a227b885a03e1182bb25475e8f47519d634e9 Mon Sep 17 00:00:00 2001 From: marcelloc Date: Wed, 8 Feb 2012 18:25:02 -0200 Subject: dansguardian - improve group name check --- config/dansguardian/dansguardian.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config/dansguardian') 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"; + } } -- cgit v1.2.3