Merge pull request #16938 from owncloud/ext-s3-opendirduplicate

Skip directory entry in S3 opendir
This commit is contained in:
Morris Jobke 2015-06-16 09:48:10 +02:00
commit b052eccd9a
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']
);