summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-12-21 06:46:22 +0100
committerlpsolit%gmail.com <>2005-12-21 06:46:22 +0100
commit85731f09a6374f82ee6b1efcffa236068b643a3c (patch)
tree6e0481d0f39fc577cee6d77bc74f31e06b6b66dd
parent4e89a5f63d93bf68a0bc8104beff55a14e67d9bc (diff)
downloadbugzilla-85731f09a6374f82ee6b1efcffa236068b643a3c.tar.gz
bugzilla-85731f09a6374f82ee6b1efcffa236068b643a3c.tar.xz
Bug 320866: Watching the same address twice produces software error - Patch by Frédéric Buclin <LpSolit@gmail.com> r=kevin r=bkor a=justdave
-rwxr-xr-xuserprefs.cgi6
1 files changed, 3 insertions, 3 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index a5590e4eb..df2255ce4 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -309,12 +309,12 @@ sub SaveEmail {
# The new information given to us by the user.
my @new_watch_names = split(/[,\s]+/, $cgi->param('watchedusers'));
- my @new_watch_ids = ();
+ my %new_watch_ids;
foreach my $username (@new_watch_names) {
my $watched_userid = DBNameToIdAndCheck(trim($username));
- push(@new_watch_ids, $watched_userid);
+ $new_watch_ids{$watched_userid} = 1;
}
- my ($removed, $added) = diff_arrays($old_watch_ids, \@new_watch_ids);
+ my ($removed, $added) = diff_arrays($old_watch_ids, [keys %new_watch_ids]);
# Remove people who were removed.
my $delete_sth = $dbh->prepare('DELETE FROM watch WHERE watched = ?'