diff options
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r-- | Bugzilla/Attachment.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index c0ea6ca0d..7cd350dde 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -795,7 +795,10 @@ sub create { # If we have a filehandle, we need its content to store it in the DB. elsif (ref $data) { local $/; - $data = <$data>; + # Store the content in a temp variable while we close the FH. + my $tmp = <$data>; + close $data; + $data = $tmp; } my $sth = $dbh->prepare("INSERT INTO attach_data |