From 247e12da966aeceb833e8c60b833e089bee89f8a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 15 Oct 2021 16:23:39 +0200 Subject: [PATCH] always set Key field in `headObject` Signed-off-by: Robin Appelman --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 527a87aeb9a2b..aa0afac15439f 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -154,6 +154,9 @@ private function headObject($key) { } } + if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]["Key"])) { + $this->objectCache[$key]["Key"] = $key; + } return $this->objectCache[$key]; } @@ -345,7 +348,6 @@ public function stat($path) { if ($object === false) { return false; } - $object["Key"] = $path; $stat = $this->objectToMetaData($object); } $stat['atime'] = time();