diff options
author | c1541@hotmail.com <> | 2011-12-08 00:12:27 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-12-08 00:12:27 +0100 |
commit | 4badf488d539d7e50c7a156ecc65514796e6345a (patch) | |
tree | 3a4b5c0007a9bc46ca1e1489033d784afa750dc6 /Bugzilla | |
parent | 65b467bd089fd3d2b2bc5343093f0e73a98e580e (diff) | |
download | bugzilla-4badf488d539d7e50c7a156ecc65514796e6345a.tar.gz bugzilla-4badf488d539d7e50c7a156ecc65514796e6345a.tar.xz |
Bug 684225: The removal of locally stored attachments should be done from Bugzilla::Attachment->remove_from_db
r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Attachment.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 3a8e7d5d5..6c39818f6 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -900,6 +900,11 @@ sub remove_from_db { $dbh->do('UPDATE attachments SET mimetype = ?, ispatch = ?, isobsolete = ? WHERE attach_id = ?', undef, ('text/plain', 0, 1, $self->id)); $dbh->bz_commit_transaction(); + + my $filename = $self->_get_local_filename; + if (-e $filename) { + unlink $filename or warn "Couldn't unlink $filename: $!"; + } } ############################### |