From 07ae61fcd3d2ecf7ccf9d6a1267ee0ab5c4c1db2 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Fri, 30 Nov 2012 10:16:46 -0500 Subject: Bug 797226 - A-dependent-bug-changed bugmail on an un-hidden bug sometimes exposes the unobscured summary of a dependent hidden bug r=glob --- extensions/SecureMail/Extension.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index 3730d23e6..1ea691320 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -195,6 +195,29 @@ sub user_preferences { $$handled = 1; } +sub template_before_process { + my ($self, $args) = @_; + my $file = $args->{'file'}; + my $vars = $args->{'vars'}; + + # Bug dependency emails contain the subject of the dependent bug + # right before the diffs when a status has gone from open/closed + # or closed/open. We need to sanitize the subject of change.blocker + # similar to how we do referenced bugs + return unless + $file eq 'email/bugmail.html.tmpl' + || $file eq 'email/bugmail.txt.tmpl'; + + if (defined $vars->{diffs}) { + foreach my $change (@{ $vars->{diffs} }) { + next if !defined $change->{blocker}; + if (grep($_->secure_mail, @{ $change->{blocker}->groups_in })) { + $change->{blocker}->{short_desc} = "(Secure bug)"; + } + } + } +} + sub _send_test_email { my ($user) = @_; my $template = Bugzilla->template_inner($user->settings->{'lang'}->{'value'}); -- cgit v1.2.3-24-g4f1b