[ticket/15276] Use stream_copy_to_stream

PHPBB3-15276
This commit is contained in:
Rubén Calvo 2017-08-18 16:18:09 +02:00
parent 87229e1a77
commit 28060a8468

View file

@ -71,13 +71,10 @@ function send_avatar_to_browser($file, $browser)
try { try {
$fp = $storage->read_stream($file_path); $fp = $storage->read_stream($file_path);
$output = fopen('php://output', 'w+b');
while (!feof($fp)) stream_copy_to_stream($fp, $output);
{
echo fread($fp, 8192);
}
fclose($fp); fclose($fp);
fclose($output);
} catch (\Exception $e) { } catch (\Exception $e) {
} }