From f0b27a65198a4fd93df87484cf14a92bed9b5596 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 8 Aug 2017 17:04:05 +0200 Subject: [PATCH] explicitly cast content length to int (#79) --- 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)) {