From: lpsolit%gmail.com <> Date: Thu, 26 Jul 2007 19:06:23 +0000 (+0000) Subject: Bug 203309: "Users to watch" in email prefs doesn't support wildcard user matching... X-Git-Tag: bugzilla-3.1.2~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a32fefa5719d8f50edee9d2210b0288a3f7c369b;p=thirdparty%2Fbugzilla.git Bug 203309: "Users to watch" in email prefs doesn't support wildcard user matching - Patch by Frédéric Buclin r=timeless a=LpSolit --- diff --git a/userprefs.cgi b/userprefs.cgi index 8f2e69f1e4..efe07921be 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -247,7 +247,11 @@ sub SaveEmail { my $dbh = Bugzilla->dbh; my $cgi = Bugzilla->cgi; my $user = Bugzilla->user; - + + if (Bugzilla->params->{"supportwatchers"}) { + Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} }); + } + ########################################################################### # Role-based preferences ########################################################################### @@ -319,7 +323,8 @@ sub SaveEmail { . " WHERE watcher = ?", undef, $user->id); # The new information given to us by the user. - my @new_watch_names = split(/[,\s]+/, $cgi->param('new_watchedusers')); + my $new_watched_users = join(',', $cgi->param('new_watchedusers')) || ''; + my @new_watch_names = split(/[,\s]+/, $new_watched_users); my %new_watch_ids; foreach my $username (@new_watch_names) {