[ticket/15699] Check if is resource before close

PHPBB3-15699
This commit is contained in:
Rubén Calvo 2018-08-01 21:04:55 +02:00 committed by Ruben Calvo
parent 9dc67e81ff
commit 8cb5ea8e20
No known key found for this signature in database

View file

@ -189,7 +189,11 @@ class acp_storage
$stream = $current_adapter->read_stream($row['file_path']);
$new_adapter->write_stream($row['file_path'], $stream);
if (is_resource($stream))
{
fclose($stream);
}
$this->state['file_index'] = $row['file_id']; // Set last uploaded file
}