Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1866162 - Fix several 'use of initialized value...' errors when running the automated UI tests #2142

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/BMO/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1728,8 +1728,8 @@ sub _log_sent_email {
$bug_id = $bug_id ? "bug-$bug_id" : '-';

my $message_type;
my $type = $email->header('X-Bugzilla-Type');
my $reason = $email->header('X-Bugzilla-Reason');
my $type = $email->header('X-Bugzilla-Type') || '';
my $reason = $email->header('X-Bugzilla-Reason') || '';
if ($type eq 'whine' || $type eq 'request' || $type eq 'admin') {
$message_type = $type;
}
Expand Down
17 changes: 9 additions & 8 deletions extensions/SecureMail/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,19 @@ sub mailer_before_send {
my ($self, $args) = @_;

my $email = $args->{'email'};
my $body = $email->body;
my $body = $email->body || '';

# Decide whether to make secure.
# This is a bit of a hack; it would be nice if it were more clear
# what sort a particular email is.
my $is_bugmail = $email->header('X-Bugzilla-Status')
|| $email->header('X-Bugzilla-Type') eq 'request';
my $is_passwordmail = !$is_bugmail && ($body =~ /cfmpw.*cxlpw/s);
my $is_test_email
= $email->header('X-Bugzilla-Type') =~ /securemail-test/ ? 1 : 0;
my $is_whine_email = $email->header('X-Bugzilla-Type') eq 'whine' ? 1 : 0;
my $encrypt_header = $email->header('X-Bugzilla-Encrypt') ? 1 : 0;
my $status = $email->header('X-Bugzilla-Status') || '';
my $type = $email->header('X-Bugzilla-Type') || '';
my $encrypt = $email->header('X-Bugzilla-Encrypt') || '';
my $is_bugmail = $status || $type eq 'request';
my $is_passwordmail = !$is_bugmail && $body =~ /cfmpw.*cxlpw/s;
my $is_test_email = $type =~ /securemail-test/ ? 1 : 0;
my $is_whine_email = $type eq 'whine' ? 1 : 0;
my $encrypt_header = $encrypt ? 1 : 0;

if ( $is_bugmail
|| $is_passwordmail
Expand Down