From 98ad1e4971fb67d3ba092a614a2c949ab37fce16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Tue, 8 Aug 2017 11:24:20 +0200 Subject: [PATCH] [ticket/15305] Use php://temp stream instead of tmpfile() The tmpfile() return a file resource, but is not in binary mode. PHPBB3-15305 --- phpBB/phpbb/storage/storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/storage/storage.php b/phpBB/phpbb/storage/storage.php index 46e75daadf..7798b28ad4 100644 --- a/phpBB/phpbb/storage/storage.php +++ b/phpBB/phpbb/storage/storage.php @@ -170,7 +170,7 @@ class storage else { // Simulate the stream - $stream = tmpfile(); + $stream = fopen('php://temp', 'w+b'); fwrite($stream, $adapter->get_contents($path)); rewind($stream); }