Merge pull request #58379 from nextcloud/backport/58285/master

fix(cache): filter out invalid entries in `OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById`
This commit is contained in:
Ferdinand Thiessen 2026-02-17 18:11:04 +01:00 committed by GitHub
commit 252449023f
2 changed files with 3 additions and 8 deletions

View file

@ -3509,11 +3509,6 @@
<code><![CDATA[self::getGlobalCache()->getStorageInfo($storageId)]]></code>
</NullableReturnStatement>
</file>
<file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php">
<LessSpecificImplementedReturnType>
<code><![CDATA[array]]></code>
</LessSpecificImplementedReturnType>
</file>
<file src="lib/private/Files/Config/MountProviderCollection.php">
<InvalidOperand>
<code><![CDATA[$user]]></code>

View file

@ -97,14 +97,14 @@ class CacheWrapper extends Cache {
}
/**
* get the metadata of all files stored in $folder
* Get the metadata of all files stored in given folder
*
* @param int $fileId the file id of the folder
* @return array
* @return ICacheEntry[]
*/
public function getFolderContentsById(int $fileId, ?string $mimeTypeFilter = null) {
$results = $this->getCache()->getFolderContentsById($fileId, $mimeTypeFilter);
return array_map($this->formatCacheEntry(...), $results);
return array_filter(array_map($this->formatCacheEntry(...), $results));
}
/**