Merge pull request #8842 from lanxenet/patch-1
fix(AmazonS3): fix loop $result['Contents'] error
This commit is contained in:
commit
b348431bce
|
@ -291,6 +291,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
$files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
|
$files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_array($result['Contents'])) {
|
||||||
foreach ($result['Contents'] as $object) {
|
foreach ($result['Contents'] as $object) {
|
||||||
if (isset($object['Key']) && $object['Key'] === $path) {
|
if (isset($object['Key']) && $object['Key'] === $path) {
|
||||||
// it's the directory itself, skip
|
// it's the directory itself, skip
|
||||||
|
@ -302,6 +303,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return IteratorDirectory::wrap($files);
|
return IteratorDirectory::wrap($files);
|
||||||
} catch (S3Exception $e) {
|
} catch (S3Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue