Commit 0b7886de authored by David Lawrence's avatar David Lawrence

Bug 1095244: DB crash when adding an alias that differs only in case from an existing alias

r=glob,a=glob
parent d0a09b15
......@@ -2905,8 +2905,19 @@ sub add_alias {
return if !$alias;
my $aliases = $self->_check_alias($alias);
$alias = $aliases->[0];
my $bug_aliases = $self->alias;
push(@$bug_aliases, $alias) if !grep($_ eq $alias, @$bug_aliases);
my @new_aliases;
my $found = 0;
foreach my $old_alias (@{ $self->alias }) {
if (lc($old_alias) eq lc($alias)) {
push(@new_aliases, $alias);
$found = 1;
}
else {
push(@new_aliases, $old_alias);
}
}
push(@new_aliases, $alias) if !$found;
$self->{alias} = \@new_aliases;
}
sub remove_alias {
......
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