Use local variable for directory name

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2019-03-30 12:27:52 +01:00
parent 75b8944061
commit 72d22a4828
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 3 additions and 2 deletions

View File

@ -334,8 +334,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
// sub folders
if (is_array($result['CommonPrefixes'])) {
foreach ($result['CommonPrefixes'] as $prefix) {
$files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
$this->directoryCache[trim($prefix['Prefix'], '/')] = true;
$directoryName = trim($prefix['Prefix'], '/');
$files[] = substr($directoryName, strlen($path));
$this->directoryCache[$directoryName] = true;
}
}
if (is_array($result['Contents'])) {