From bb43a763e5b23fecf8bec723b7eb2b71479b5ecc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 23 Jul 2020 13:47:50 +0200 Subject: [PATCH] Fix truncated FontManager downloads on Windows --- .../install/files/lib/system/style/FontManager.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/style/FontManager.class.php b/wcfsetup/install/files/lib/system/style/FontManager.class.php index 0e2907876d..c9ba1d4a9d 100644 --- a/wcfsetup/install/files/lib/system/style/FontManager.class.php +++ b/wcfsetup/install/files/lib/system/style/FontManager.class.php @@ -86,11 +86,14 @@ class FontManager extends SingletonFactory { throw new \InvalidArgumentException("Invalid filename '".$filename."' given."); } - $response = $this->http->send(new Request('GET', $family.'/'.$filename)); + $response = $this->http->send(new Request('GET', $family.'/'.$filename), [ + // https://github.com/guzzle/guzzle/issues/2735 + 'sink' => fopen("php://temp", "w+"), + ]); $file = new AtomicWriter($familyDirectory.'/'.$filename); while (!$response->getBody()->eof()) { - $file->write($response->getBody()->read(4096)); + $file->write($response->getBody()->read(8192)); } $response->getBody()->close(); $file->flush(); -- 2.20.1