From 40801fa1c1cab69c79abbb261e9119447825b0fc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 Jun 2017 14:11:23 +0200 Subject: [PATCH] explicitly cast content length to int --- lib/Sapi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Sapi.php b/lib/Sapi.php index 10c8132..d9cad3f 100644 --- a/lib/Sapi.php +++ b/lib/Sapi.php @@ -90,7 +90,7 @@ static function sendResponse(ResponseInterface $response) { if (is_resource($body) && get_resource_type($body) == 'stream') { if (PHP_INT_SIZE !== 4){ // use the dedicated function on 64 Bit systems - stream_copy_to_stream($body, $output, $contentLength); + stream_copy_to_stream($body, $output, (int)$contentLength); } else { // workaround for 32 Bit systems to avoid stream_copy_to_stream while (!feof($body)) {