diff options
Diffstat (limited to 'utils/rhrd-show')
-rwxr-xr-x | utils/rhrd-show | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/rhrd-show b/utils/rhrd-show index 60a322c..8360c5c 100755 --- a/utils/rhrd-show +++ b/utils/rhrd-show @@ -72,7 +72,13 @@ sub show sub add__check_arguments { - my ($name, $title, $num_carts, $rhythm, $dow, $starttime, $len) = @_; + my ($groupname, $name, $title, $num_carts, $rhythm, $dow, $starttime, $len) = @_; + + if($groupname !~ m/^[-a-zA-Z0-9_]{1,10}$/) { + print STDERR "name '" . $groupname . "' contains illegal characters or is too long/short\n"; + print STDERR " only a-z, A-Z, 0-9 and _,- are allowed and the length must be between 1 and 10\n"; + return 1; + } if($name !~ m/^[a-zA-Z0-9_]{1,10}$/) { print STDERR "name '" . $name . "' contains illegal characters or is too long/short\n"; @@ -116,7 +122,7 @@ sub add { my ($ctx, $groupname, $name, $title, $num_carts, $rhythm, $dow, $starttime, $len) = @_; - my $ret = add__check_arguments($name, $title, $num_carts, $rhythm, $dow, $starttime, $len); + my $ret = add__check_arguments($groupname, $name, $title, $num_carts, $rhythm, $dow, $starttime, $len); if($ret) { return $ret; } |