From d3f828af45817c1f2408bed003a83d79fd801a87 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 15 Jun 2015 17:23:17 +0200 Subject: Skip directory entry in S3 opendir The result set contains the directory itself, so skip it to avoid scanning a non-existing directory --- apps/files_external/lib/amazons3.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files_external') diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index acf976e8fe4..763cf59aa4c 100644 --- a/apps/files_external/lib/amazons3.php +++ b/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'] ); -- cgit v1.2.3