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:
Vincent Petry 2015-06-15 17:23:17 +02:00
parent b6165b6865
commit d3f828af45
1 changed files with 4 additions and 0 deletions

View File

@ -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']
);