summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Mailer.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-09-06 12:41:31 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-09-06 12:41:31 +0200
commit23807179790108fc2575d06df59dbaebf8ce0af8 (patch)
treeed9e1b383de7f72f1892c66552640240c431f5f2 /Bugzilla/Mailer.pm
parenta666b2a74f565a5ebb38f0ce0b400d04b1ea7ca4 (diff)
downloadbugzilla-23807179790108fc2575d06df59dbaebf8ce0af8.tar.gz
bugzilla-23807179790108fc2575d06df59dbaebf8ce0af8.tar.xz
Bug 1194987: Editing your email address and make it point to a non-existent email address makes Bugzilla stop working
r=gerv a=sgreen
Diffstat (limited to 'Bugzilla/Mailer.pm')
-rw-r--r--Bugzilla/Mailer.pm15
1 files changed, 6 insertions, 9 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index 593a1067a..20175db15 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -260,17 +260,14 @@ sub build_thread_marker {
sub send_staged_mail {
my $dbh = Bugzilla->dbh;
- my @ids;
- my $emails
- = $dbh->selectall_arrayref("SELECT id, message FROM mail_staging");
- foreach my $row (@$emails) {
- MessageToMTA($row->[1]);
- push(@ids, $row->[0]);
- }
+ my $emails = $dbh->selectall_arrayref('SELECT id, message FROM mail_staging');
+ my $sth = $dbh->prepare('DELETE FROM mail_staging WHERE id = ?');
- if (@ids) {
- $dbh->do("DELETE FROM mail_staging WHERE " . $dbh->sql_in('id', \@ids));
+ foreach my $email (@$emails) {
+ my ($id, $message) = @$email;
+ MessageToMTA($message);
+ $sth->execute($id);
}
}