Skip to content

Commit

Permalink
Fixed missing usage of $propertiesToExtract in StorageDriver::getFile…
Browse files Browse the repository at this point in the history
…InfoByIdentifier() (#33)

 Fixed missing usage of $propertiesToExtract in StorageDriver::getFileInfoByIdentifier() closes #32
  • Loading branch information
svenpet90 authored Feb 20, 2022
1 parent 48deb60 commit caa06f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Classes/Driver/StorageDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,17 +694,24 @@ public function getFileInfoByIdentifier($fileIdentifier, array $propertiesToExtr
$properties = $blob->getProperties();
$fileInfo['size'] = $properties->getContentLength();
$fileInfo['mimetype'] = $properties->getContentType();

}

return array_merge($fileInfo, [
$fileInfo = array_merge($fileInfo, [
'identifier' => $fileIdentifier,
'name' => basename(rtrim($fileIdentifier, '/')),
'storage' => $this->storageUid,
'identifier_hash' => $this->hashIdentifier($fileIdentifier),
'folder_hash' => $this->hashIdentifier($this->getParentFolderIdentifierOfIdentifier($fileIdentifier)),
'mtime' => $properties->getLastModified()->format('U'),
]);

$fileInfoToExtract = [];

foreach ($propertiesToExtract as $propertyName) {
$fileInfoToExtract[$propertyName] = $fileInfo[$propertyName];
}

return $fileInfoToExtract ?: $fileInfo;
}

/**
Expand Down

0 comments on commit caa06f1

Please sign in to comment.