fix(cache): filter out invalid entries in OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2026-02-12 14:53:55 +01:00 committed by backportbot[bot]
parent 6654942b2a
commit 0c8b04e141
2 changed files with 3 additions and 9 deletions

View file

@ -3705,12 +3705,6 @@
<code><![CDATA[$this->cache instanceof Cache]]></code>
</RedundantCondition>
</file>
<file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php">
<LessSpecificImplementedReturnType>
<code><![CDATA[array]]></code>
<code><![CDATA[array]]></code>
</LessSpecificImplementedReturnType>
</file>
<file src="lib/private/Files/Config/MountProviderCollection.php">
<InvalidOperand>
<code><![CDATA[$user]]></code>

View file

@ -100,14 +100,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($fileId) {
$results = $this->getCache()->getFolderContentsById($fileId);
return array_map([$this, 'formatCacheEntry'], $results);
return array_filter(array_map($this->formatCacheEntry(...), $results));
}
/**