From b3b567e78655dd37f7d5e91b7568a97ba1aa2fb3 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 9 Mar 2023 15:22:38 +0100 Subject: chore: Address review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/private/Files/ObjectStore/ObjectStoreStorage.php') diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 389f744eab4..3494a7db806 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -661,10 +661,6 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil return $this->objectStore->initiateMultipartUpload($urn); } - /** - * - * @throws GenericFileException - */ public function putChunkedWritePart( string $targetPath, string $writeToken, @@ -675,6 +671,11 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil if (!$this->objectStore instanceof IObjectStoreMultiPartUpload) { throw new GenericFileException('Object store does not support multipart upload'); } + + if (!is_numeric($chunkId)) { + throw new GenericFileException('Chunk ID must be numeric for S3 multipart upload'); + } + $cacheEntry = $this->getCache()->get($targetPath); $urn = $this->getURN($cacheEntry->getId()); -- cgit v1.2.3