summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Attachment.pm5
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: $!";
+ }
}
###############################