From 5934bdaaf108b59129be5ffbf7260267742790ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 16 Jun 2018 17:42:58 +0200 Subject: [PATCH] [ticket/15692] Close db connection after use storage PHPBB3-15692 --- phpBB/includes/functions_download.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 6e25c0fbdb..b599e78a39 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -223,9 +223,6 @@ function send_file_to_browser($attachment, $category) } } - // Close the db connection before sending the file etc. - file_gc(false); - if (!set_modified_headers($attachment['filetime'], $user->browser)) { if ($size) @@ -238,6 +235,9 @@ function send_file_to_browser($attachment, $category) $fp = $storage->read_stream($filename); + // Close the db connection before sending the file etc. + file_gc(false); + if ($fp !== false) { $output = fopen('php://output', 'w+b');