mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
fix s3 doesDirectoryExist check for empty directories
if a directory is empty, only the 'marker' object `/` exists. since not all s3 implementations return just the prefix when listing objects by prefix, when listing objects by the folder prefix, nothing will be returned if the directory is empty. by not including the trailing slash in the prefix, the folder marked will always be returned if it exists Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
a3f4b6ba94
commit
4163ee97ef
1 changed files with 1 additions and 1 deletions
|
|
@ -159,7 +159,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
try {
|
||||
$result = $this->getConnection()->listObjects([
|
||||
'Bucket' => $this->bucket,
|
||||
'Prefix' => rtrim($path, '/') . '/',
|
||||
'Prefix' => rtrim($path, '/'),
|
||||
'MaxKeys' => 1,
|
||||
]);
|
||||
$this->directoryCache[$path] = $result['Contents'] || $result['CommonPrefixes'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue