Commit fdc4581f authored by Matt Tyson's avatar Matt Tyson Committed by Frédéric Buclin

Bug 1186700: Inserting data into the mail_staging table fails on PostgreSQL due…

Bug 1186700: Inserting data into the mail_staging table fails on PostgreSQL due to unspecified BLOB type r=gerv a=sgreen
parent 7fec5691
...@@ -41,6 +41,8 @@ sub MessageToMTA { ...@@ -41,6 +41,8 @@ sub MessageToMTA {
return; return;
} }
my $dbh = Bugzilla->dbh;
my $email; my $email;
if (ref $msg) { if (ref $msg) {
$email = $msg; $email = $msg;
...@@ -58,11 +60,14 @@ sub MessageToMTA { ...@@ -58,11 +60,14 @@ sub MessageToMTA {
# email immediately, in case the transaction is rolled back. Instead we # email immediately, in case the transaction is rolled back. Instead we
# insert it into the mail_staging table, and bz_commit_transaction calls # insert it into the mail_staging table, and bz_commit_transaction calls
# send_staged_mail() after the transaction is committed. # send_staged_mail() after the transaction is committed.
if (! $send_now && Bugzilla->dbh->bz_in_transaction()) { if (! $send_now && $dbh->bz_in_transaction()) {
# The e-mail string may contain tainted values. # The e-mail string may contain tainted values.
my $string = $email->as_string; my $string = $email->as_string;
trick_taint($string); trick_taint($string);
Bugzilla->dbh->do("INSERT INTO mail_staging (message) VALUES(?)", undef, $string);
my $sth = $dbh->prepare("INSERT INTO mail_staging (message) VALUES (?)");
$sth->bind_param(1, $string, $dbh->BLOB_TYPE);
$sth->execute;
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment