]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 320866: Watching the same address twice produces software error - Patch by Frédér...
authorlpsolit%gmail.com <>
Wed, 21 Dec 2005 05:49:26 +0000 (05:49 +0000)
committerlpsolit%gmail.com <>
Wed, 21 Dec 2005 05:49:26 +0000 (05:49 +0000)
userprefs.cgi

index 8d59a34e3174e6cd6661b2c3d20a7d8edc5664c3..02646568d8e4b8e7effe783d52ff737fa95c1706 100755 (executable)
@@ -281,12 +281,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 = ?'