diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index cb40ac547e..bd9f767d39 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -192,8 +192,6 @@ class acp_database fclose($fp); } - $storage->track_file($file); - // Remove file from tmp @unlink($temp_dir . '/' . $file); diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php index 6202798e05..37978944aa 100644 --- a/phpBB/phpbb/attachment/upload.php +++ b/phpBB/phpbb/attachment/upload.php @@ -254,8 +254,6 @@ class upload { fclose($fp); } - - $this->storage->track_file($destination_name); } else { diff --git a/phpBB/phpbb/files/filespec_storage.php b/phpBB/phpbb/files/filespec_storage.php index 5f3b895a05..adf4135193 100644 --- a/phpBB/phpbb/files/filespec_storage.php +++ b/phpBB/phpbb/files/filespec_storage.php @@ -456,8 +456,6 @@ class filespec_storage { fclose($fp); } - - $storage->track_file($this->destination_file); } catch (\phpbb\storage\exception\exception $e) { diff --git a/phpBB/phpbb/storage/adapter/local.php b/phpBB/phpbb/storage/adapter/local.php index c7fbe544e9..70df8043c8 100644 --- a/phpBB/phpbb/storage/adapter/local.php +++ b/phpBB/phpbb/storage/adapter/local.php @@ -348,6 +348,8 @@ class local implements adapter_interface, stream_interface fclose($stream); throw new exception('STORAGE_CANNOT_COPY_RESOURCE'); } + + fclose($stream); } /** diff --git a/phpBB/phpbb/storage/storage.php b/phpBB/phpbb/storage/storage.php index 97d71048ee..7f9a7fdbb0 100644 --- a/phpBB/phpbb/storage/storage.php +++ b/phpBB/phpbb/storage/storage.php @@ -212,7 +212,6 @@ class storage /** * Writes a new file using a stream - * The file needs to be tracked after using this method * * @param string $path The target file * @param resource $resource The resource @@ -226,6 +225,7 @@ class storage if ($adapter instanceof stream_interface) { $adapter->write_stream($path, $resource); + $this->track_file($path); } else {