fix(AmazonS3): fix loop $result['Contents'] error
Invalid argument supplied for foreach() at /var/www/html/apps/files_external/lib/Lib/Storage/AmazonS3.php#295
This commit is contained in:
parent
af2ecbbd5a
commit
65bb12032d
|
@ -292,15 +292,17 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
$files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
|
$files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($result['Contents'] as $object) {
|
if (is_array($result['Contents'])) {
|
||||||
if (isset($object['Key']) && $object['Key'] === $path) {
|
foreach ($result['Contents'] as $object) {
|
||||||
// it's the directory itself, skip
|
if (isset($object['Key']) && $object['Key'] === $path) {
|
||||||
continue;
|
// it's the directory itself, skip
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$file = basename(
|
||||||
|
isset($object['Key']) ? $object['Key'] : $object['Prefix']
|
||||||
|
);
|
||||||
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
$file = basename(
|
|
||||||
isset($object['Key']) ? $object['Key'] : $object['Prefix']
|
|
||||||
);
|
|
||||||
$files[] = $file;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue