Skip to content
Snippets Groups Projects
Commit d3f828af authored by Vincent Petry's avatar Vincent Petry
Browse files

Skip directory entry in S3 opendir

The result set contains the directory itself, so skip it to avoid
scanning a non-existing directory
parent b6165b68
No related branches found
No related tags found
No related merge requests found
...@@ -274,6 +274,10 @@ class AmazonS3 extends \OC\Files\Storage\Common { ...@@ -274,6 +274,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
), array('return_prefixes' => true)); ), array('return_prefixes' => true));
foreach ($result as $object) { foreach ($result as $object) {
if (isset($object['Key']) && $object['Key'] === $path) {
// it's the directory itself, skip
continue;
}
$file = basename( $file = basename(
isset($object['Key']) ? $object['Key'] : $object['Prefix'] isset($object['Key']) ? $object['Key'] : $object['Prefix']
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment