From 816e737326fed0671edc48d5710202cd434ad505 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 5 Apr 2012 12:53:20 -0400 Subject: Bug 741996 - approval-mozilla-esr10 flag request mails show real subject for security bugs r=gerv --- extensions/SecureMail/Extension.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'extensions/SecureMail') diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index 11a67d5fd..21541f845 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -227,9 +227,12 @@ sub mailer_before_send { if ($is_bugmail) { # This is also a bit of a hack, but there's no header with the # bug ID in. So we take the first number in the subject. - my ($bug_id) = ($email->header('Subject') =~ /^[^\d]+(\d+)/); + my ($bug_id) = ($email->header('Subject') =~ /\[\D+(\d+)\]/); my $bug = new Bugzilla::Bug($bug_id); - if ($bug && !grep($_->{secure_mail}, @{ $bug->groups_in })) { + if ($bug + && !$bug->{'error'} + && !grep($_->{secure_mail}, @{ $bug->groups_in })) + { $make_secure = 0; } } @@ -262,7 +265,7 @@ sub _make_secure { my ($email, $key, $sanitise_subject) = @_; my $subject = $email->header('Subject'); - my ($bug_id) = $subject =~ /^\D+(\d+)/; + my ($bug_id) = $subject =~ /\[\D+(\d+)\]/; my $key_type = 0; if ($key && $key =~ /PUBLIC KEY/) { -- cgit v1.2.3-24-g4f1b