Commit bb182f46 authored by sikeda's avatar sikeda
Browse files

[-dev] Sympa::Regexps::listname should not contain max length.

Length would be checked when new list is created or list is renamed.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@11790 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 1d68a10c
......@@ -175,7 +175,8 @@ sub create_list_old {
$param->{'listname'} = lc($param->{'listname'});
my $listname_regexp = Sympa::Regexps::listname();
unless ($param->{'listname'} =~ /^$listname_regexp$/i) {
unless ($param->{'listname'} =~ /^$listname_regexp$/i
and length $param->{'listname'} <= Sympa::Constants::LIST_LEN()) {
Log::do_log('err', 'Incorrect listname %s', $param->{'listname'});
return undef;
}
......@@ -407,7 +408,8 @@ sub create_list {
$param->{'listname'} = lc($param->{'listname'});
my $listname_regexp = Sympa::Regexps::listname();
unless ($param->{'listname'} =~ /^$listname_regexp$/i) {
unless ($param->{'listname'} =~ /^$listname_regexp$/i
and length $param->{'listname'} <= Sympa::Constants::LIST_LEN()) {
Log::do_log('err', 'Incorrect listname %s', $param->{'listname'});
return undef;
}
......@@ -767,7 +769,8 @@ sub rename_list {
my $new_listname = lc($param{'new_listname'});
my $listname_regexp = Sympa::Regexps::listname();
unless ($new_listname =~ /^$listname_regexp$/i) {
unless ($new_listname =~ /^$listname_regexp$/i
and length $new_listname <= Sympa::Constants::LIST_LEN()) {
Log::do_log('err', 'Incorrect listname %s', $new_listname);
return 'incorrect_listname';
}
......
......@@ -37,7 +37,7 @@ use constant template_name => qr'[a-zA-Z0-9][a-zA-Z0-9\-\.\+_\s]*';
use constant host => qr'[\w\.\-]+';
use constant multiple_host_with_port =>
'[\w\.\-]+(:\d+)?(,[\w\.\-]+(:\d+)?)*';
use constant listname => qr'[a-z0-9][a-z0-9\-\.\+_]{0,49}';
use constant listname => qr'[a-z0-9][a-z0-9\-\.\+_]*';
use constant sql_query => qr'(SELECT|select).*';
use constant scenario => qr'[\w,\.\-]+';
use constant task => qr'\w+';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment