From 85731f09a6374f82ee6b1efcffa236068b643a3c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 21 Dec 2005 05:46:22 +0000 Subject: [PATCH] =?utf8?q?Bug=20320866:=20Watching=20the=20same=20address?= =?utf8?q?=20twice=20produces=20software=20error=20-=20Patch=20by=20Fr?= =?utf8?q?=C3=A9d=C3=A9ric=20Buclin=20=20r=3Dkevin=20r?= =?utf8?q?=3Dbkor=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- userprefs.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userprefs.cgi b/userprefs.cgi index a5590e4eb4..df2255ce42 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 = ?' -- 2.47.2