From 8cb5ea8e209e881b71b1eff2379adc703bb441f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Wed, 1 Aug 2018 21:04:55 +0200 Subject: [PATCH] [ticket/15699] Check if is resource before close PHPBB3-15699 --- phpBB/includes/acp/acp_storage.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_storage.php b/phpBB/includes/acp/acp_storage.php index bddf1cf460..3eb3449854 100644 --- a/phpBB/includes/acp/acp_storage.php +++ b/phpBB/includes/acp/acp_storage.php @@ -189,7 +189,11 @@ class acp_storage $stream = $current_adapter->read_stream($row['file_path']); $new_adapter->write_stream($row['file_path'], $stream); - fclose($stream); + + if (is_resource($stream)) + { + fclose($stream); + } $this->state['file_index'] = $row['file_id']; // Set last uploaded file }