From 28060a84683b39f826f8fc64ab59ad9c4bd5d79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 18 Aug 2017 16:18:09 +0200 Subject: [PATCH] [ticket/15276] Use stream_copy_to_stream PHPBB3-15276 --- phpBB/includes/functions_download.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 1503510fcf..4cbf6e16ee 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -71,13 +71,10 @@ function send_avatar_to_browser($file, $browser) try { $fp = $storage->read_stream($file_path); - - while (!feof($fp)) - { - echo fread($fp, 8192); - } - + $output = fopen('php://output', 'w+b'); + stream_copy_to_stream($fp, $output); fclose($fp); + fclose($output); } catch (\Exception $e) { }