[Pkg-owncloud-commits] [owncloud] 419/457: Skip directory entry in S3 opendir

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit d3f828af45817c1f2408bed003a83d79fd801a87
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Jun 15 17:23:17 2015 +0200

    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(+)

diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index acf976e..763cf59 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']
 				);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list