diff options
author | Louis Chemineau <louis@chmn.me> | 2023-10-23 15:26:43 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-11-02 10:13:24 +0000 |
commit | 17ca96d20514b9de6417ccf2155607f58858a68d (patch) | |
tree | ce008f1169d8c26b5f0c3dcaa48a07cfb5c529e6 /apps | |
parent | 34acba0ae7b6e7230fdb6f77be3a12f14d1d9db5 (diff) | |
download | nextcloud-server-17ca96d20514b9de6417ccf2155607f58858a68d.tar.gz nextcloud-server-17ca96d20514b9de6417ccf2155607f58858a68d.zip |
Return correct status if touch failed
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index e9398815055..8e2a6b8ea12 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -550,18 +550,20 @@ class AmazonS3 extends \OC\Files\Storage\Common { ]; try { - if (!$this->file_exists($path)) { - $mimeType = $this->mimeDetector->detectPath($path); - $this->getConnection()->putObject([ - 'Bucket' => $this->bucket, - 'Key' => $this->cleanKey($path), - 'Metadata' => $metadata, - 'Body' => '', - 'ContentType' => $mimeType, - 'MetadataDirective' => 'REPLACE', - ]); - $this->testTimeout(); + if ($this->file_exists($path)) { + return false; } + + $mimeType = $this->mimeDetector->detectPath($path); + $this->getConnection()->putObject([ + 'Bucket' => $this->bucket, + 'Key' => $this->cleanKey($path), + 'Metadata' => $metadata, + 'Body' => '', + 'ContentType' => $mimeType, + 'MetadataDirective' => 'REPLACE', + ]); + $this->testTimeout(); } catch (S3Exception $e) { $this->logger->error($e->getMessage(), [ 'app' => 'files_external', |