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 committed by Backportbot
parent 42b905c070
commit 0263bc2e35
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'])) {