diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /Bugzilla/Attachment/Database.pm | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'Bugzilla/Attachment/Database.pm')
-rw-r--r-- | Bugzilla/Attachment/Database.pm | 52 |
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; |