Commit a2631d18 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 385897: editwhines.cgi doesn't allow to whine at groups with a name…

Bug 385897: editwhines.cgi doesn't allow to whine at groups with a name containing blanks - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=wurblzap a=LpSolit
parent 39406204
...@@ -238,28 +238,13 @@ if ($cgi->param('update')) { ...@@ -238,28 +238,13 @@ if ($cgi->param('update')) {
# get an id for the mailto address # get an id for the mailto address
if ($can_mail_others && $mailto) { if ($can_mail_others && $mailto) {
if ($mailto_type == MAILTO_USER) { if ($mailto_type == MAILTO_USER) {
# detaint $mailto_id = login_to_id($mailto);
my $emailregexp = Bugzilla->params->{'emailregexp'};
if ($mailto =~ /($emailregexp)/) {
$mailto_id = login_to_id($1);
}
else {
ThrowUserError("illegal_email_address",
{ addr => $mailto });
}
} }
elsif ($mailto_type == MAILTO_GROUP) { elsif ($mailto_type == MAILTO_GROUP) {
# detaint the group parameter # The group name is used in a placeholder.
if ($mailto =~ /^([0-9a-z_\-\.]+)$/i) { trick_taint($mailto);
$mailto_id = Bugzilla::Group::ValidateGroupName( $mailto_id = Bugzilla::Group::ValidateGroupName($mailto, ($user))
$1, ($user)) || || ThrowUserError('invalid_group_name', { name => $mailto });
ThrowUserError(
'invalid_group_name',
{ name => $1 });
} else {
ThrowUserError('invalid_group_name',
{ name => $mailto });
}
} }
else { else {
# bad value, so it will just mail to the whine # bad value, so it will just mail to the whine
......
Markdown is supported
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