From 41dc0e36789f9fc3d977fcd879449ea7b8e8233f Mon Sep 17 00:00:00 2001 From: KnifeLemon Date: Fri, 17 Oct 2025 11:13:01 +0900 Subject: [PATCH 1/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- flight/net/Request.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flight/net/Request.php b/flight/net/Request.php index 4341b08..134a83d 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -711,18 +711,19 @@ class Request case 'p': // PentaByte case 'pb': $value *= 1024; + return (int)$value; case 't': // Terabyte - case 'tb': $value *= 1024; + return (int)$value; case 'g': // Gigabyte - case 'gb': $value *= 1024; + return (int)$value; case 'm': // Megabyte - case 'mb': $value *= 1024; + return (int)$value; case 'k': // Kilobyte - case 'kb': $value *= 1024; + return (int)$value; case 'b': // Byte return (int)$value; default: From bbf5204da675491e6ad5a3f117add405342d1469 Mon Sep 17 00:00:00 2001 From: KnifeLemon Date: Fri, 17 Oct 2025 11:16:52 +0900 Subject: [PATCH 2/2] fix: initialize tmp_name as empty string instead of null --- flight/net/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/net/Request.php b/flight/net/Request.php index 134a83d..4dd81e7 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -650,7 +650,7 @@ class Request 'name' => $headers['content-disposition']['filename'], 'type' => $headers['content-type'] ?? 'application/octet-stream', 'size' => mb_strlen($value, '8bit'), - 'tmp_name' => null, + 'tmp_name' => '', 'error' => UPLOAD_ERR_OK, ];