From a8232d8198e8955648ae2ddf0c1f33d909bcae53 Mon Sep 17 00:00:00 2001 From: halfpastfouram Date: Fri, 3 Jul 2020 17:23:45 +0200 Subject: [PATCH 1/2] Fixes laminas/laminas-diactoros#10 Signed-off-by: halfpastfouram --- src/functions/create_uploaded_file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/create_uploaded_file.php b/src/functions/create_uploaded_file.php index d4eeb279..14107665 100644 --- a/src/functions/create_uploaded_file.php +++ b/src/functions/create_uploaded_file.php @@ -32,8 +32,8 @@ function createUploadedFile(array $spec) : UploadedFile return new UploadedFile( $spec['tmp_name'], - $spec['size'], - $spec['error'], + intval($spec['size']), + intval($spec['error']), $spec['name'] ?? null, $spec['type'] ?? null ); From 95e21995dcf33e6121fae41cbae19832d13e71c2 Mon Sep 17 00:00:00 2001 From: halfpastfouram Date: Fri, 3 Jul 2020 23:34:41 +0200 Subject: [PATCH 2/2] Only cast size to an integer. Signed-off-by: halfpastfouram --- src/functions/create_uploaded_file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/create_uploaded_file.php b/src/functions/create_uploaded_file.php index 14107665..32e4c315 100644 --- a/src/functions/create_uploaded_file.php +++ b/src/functions/create_uploaded_file.php @@ -32,8 +32,8 @@ function createUploadedFile(array $spec) : UploadedFile return new UploadedFile( $spec['tmp_name'], - intval($spec['size']), - intval($spec['error']), + (int) $spec['size'], + $spec['error'], $spec['name'] ?? null, $spec['type'] ?? null );