mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Skip directory entry in S3 opendir
The result set contains the directory itself, so skip it to avoid scanning a non-existing directory
This commit is contained in:
parent
b6165b6865
commit
d3f828af45
1 changed files with 4 additions and 0 deletions
|
|
@ -274,6 +274,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
), array('return_prefixes' => true));
|
||||
|
||||
foreach ($result as $object) {
|
||||
if (isset($object['Key']) && $object['Key'] === $path) {
|
||||
// it's the directory itself, skip
|
||||
continue;
|
||||
}
|
||||
$file = basename(
|
||||
isset($object['Key']) ? $object['Key'] : $object['Prefix']
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue