summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment/Database.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Attachment/Database.pm')
-rw-r--r--Bugzilla/Attachment/Database.pm52
1 files changed, 22 insertions, 30 deletions
diff --git a/Bugzilla/Attachment/Database.pm b/Bugzilla/Attachment/Database.pm
index 42cdd2d6f..661ac9131 100644
--- a/Bugzilla/Attachment/Database.pm
+++ b/Bugzilla/Attachment/Database.pm
@@ -14,48 +14,40 @@ use warnings;
use Bugzilla::Util qw(trick_taint);
sub new {
- return bless({}, shift);
+ return bless({}, shift);
}
sub store {
- my ($self, $attach_id, $data) = @_;
- my $dbh = Bugzilla->dbh;
- my $sth = $dbh->prepare("INSERT INTO attach_data (id, thedata) VALUES ($attach_id, ?)");
- trick_taint($data);
- $sth->bind_param(1, $data, $dbh->BLOB_TYPE);
- $sth->execute();
+ my ($self, $attach_id, $data) = @_;
+ my $dbh = Bugzilla->dbh;
+ my $sth = $dbh->prepare(
+ "INSERT INTO attach_data (id, thedata) VALUES ($attach_id, ?)");
+ trick_taint($data);
+ $sth->bind_param(1, $data, $dbh->BLOB_TYPE);
+ $sth->execute();
}
sub retrieve {
- my ($self, $attach_id) = @_;
- my $dbh = Bugzilla->dbh;
- my ($data) = $dbh->selectrow_array(
- "SELECT thedata FROM attach_data WHERE id = ?",
- undef,
- $attach_id
- );
- return $data;
+ my ($self, $attach_id) = @_;
+ my $dbh = Bugzilla->dbh;
+ my ($data)
+ = $dbh->selectrow_array("SELECT thedata FROM attach_data WHERE id = ?",
+ undef, $attach_id);
+ return $data;
}
sub remove {
- my ($self, $attach_id) = @_;
- my $dbh = Bugzilla->dbh;
- $dbh->do(
- "DELETE FROM attach_data WHERE id = ?",
- undef,
- $attach_id
- );
+ my ($self, $attach_id) = @_;
+ my $dbh = Bugzilla->dbh;
+ $dbh->do("DELETE FROM attach_data WHERE id = ?", undef, $attach_id);
}
sub exists {
- my ($self, $attach_id) = @_;
- my $dbh = Bugzilla->dbh;
- my ($exists) = $dbh->selectrow_array(
- "SELECT 1 FROM attach_data WHERE id = ?",
- undef,
- $attach_id
- );
- return !!$exists;
+ my ($self, $attach_id) = @_;
+ my $dbh = Bugzilla->dbh;
+ my ($exists) = $dbh->selectrow_array("SELECT 1 FROM attach_data WHERE id = ?",
+ undef, $attach_id);
+ return !!$exists;
}
1;