Browse Source

Skip directory entry in S3 opendir

The result set contains the directory itself, so skip it to avoid
scanning a non-existing directory
remotes/origin/poc-doctrine-migrations
Vincent Petry 11 years ago
parent
commit
d3f828af45
  1. 4
      apps/files_external/lib/amazons3.php

4
apps/files_external/lib/amazons3.php

@ -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…
Cancel
Save