From e85e9124e9f58fecf7ef85b6e1c71a409e6d55fa Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 27 Feb 2026 13:24:56 -0500 Subject: [PATCH] fix(Multipart): properly handle falsey values like "0" --- .changes/nextrelease/multipart-falsy-values.json | 7 +++++++ src/Multipart/AbstractUploadManager.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/nextrelease/multipart-falsy-values.json diff --git a/.changes/nextrelease/multipart-falsy-values.json b/.changes/nextrelease/multipart-falsy-values.json new file mode 100644 index 0000000000..58d0cad1d5 --- /dev/null +++ b/.changes/nextrelease/multipart-falsy-values.json @@ -0,0 +1,7 @@ +[ + { + "type": "bugfix", + "category": "Multipart", + "description": "Fixes bug in `AbstractUploadManager` where valid falsy values are excluded." + } +] diff --git a/src/Multipart/AbstractUploadManager.php b/src/Multipart/AbstractUploadManager.php index adc356ede4..96848fd6ca 100644 --- a/src/Multipart/AbstractUploadManager.php +++ b/src/Multipart/AbstractUploadManager.php @@ -240,7 +240,7 @@ private function determineState(): UploadState $id = [$required['upload_id'] => null]; unset($required['upload_id']); foreach ($required as $key => $param) { - if (!$this->config[$key]) { + if (!isset($this->config[$key]) || $this->config[$key] === '') { throw new IAE('You must provide a value for "' . $key . '" in ' . 'your config for the MultipartUploader for ' . $this->client->getApi()->getServiceFullName() . '.');