summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Flag.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-08-11 05:55:09 +0200
committerlpsolit%gmail.com <>2006-08-11 05:55:09 +0200
commitd89140b00e196de6d4d6f2c8e3b163784b5c15ff (patch)
tree02fb15328af4445a7bcc041dc9e79c3b83221d57 /Bugzilla/Flag.pm
parent91986ae4f25eed69862b8d0b5f176e84339c6052 (diff)
downloadbugzilla-d89140b00e196de6d4d6f2c8e3b163784b5c15ff.tar.gz
bugzilla-d89140b00e196de6d4d6f2c8e3b163784b5c15ff.tar.xz
Bug 348070: An arrayref is always "true" - Patch by Frédéric Buclin <LpSolit@gmail.com> a=myk
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r--Bugzilla/Flag.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index e46a9b17c..42d747d60 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -838,12 +838,14 @@ sub notify {
# to make sure we don't send email about it to unauthorized users
# on the request type's CC: list, so we have to trawl the list for users
# not in those groups or email addresses that don't have an account.
- if ($bug->groups || $attachment_is_private) {
+ my @bug_in_groups = grep {$_->{'ison'} || $_->{'mandatory'}} @{$bug->groups};
+
+ if (scalar(@bug_in_groups) || $attachment_is_private) {
my @new_cc_list;
foreach my $cc (split(/[, ]+/, $flag->type->cc_list)) {
my $ccuser = Bugzilla::User->new_from_login($cc) || next;
- next if ($bug->groups && !$ccuser->can_see_bug($bug->bug_id));
+ next if (scalar(@bug_in_groups) && !$ccuser->can_see_bug($bug->bug_id));
next if $attachment_is_private
&& Bugzilla->params->{"insidergroup"}
&& !$ccuser->in_group(Bugzilla->params->{"insidergroup"});