From 72d22a48284dd9e700d3586db65cca50e9d6f2f0 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sat, 30 Mar 2019 12:27:52 +0100 Subject: [PATCH] Use local variable for directory name Signed-off-by: Daniel Kesselberg --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index befa656710..c6cd6e1b2c 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -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'])) {