Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function opendir($path) {
$files[] = $file;

// store this information for later usage
$this->filesCache[$file] = [
$this->filesCache[$path . $file] = [
'ContentLength' => $object['Size'],
'LastModified' => (string)$object['LastModified'],
];
Expand Down Expand Up @@ -408,7 +408,7 @@ public function filetype($path) {
}

try {
if ($this->headObject($path)) {
if (isset($this->filesCache[$path]) && $this->headObject($path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reasoning here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If filesCache has been populated by opendir we already know that path is a file or not without calling headObject. If you wonder about "only call headObject if $path isset in filescache" 0d667d1

return 'file';
}
if ($this->headObject($path . '/')) {
Expand Down