Merge pull request #58378 from nextcloud/backport/58285/stable33

[stable33] fix(cache): filter out invalid entries in `OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById`
This commit is contained in:
Andy Scherzinger 2026-02-19 23:34:29 +01:00 committed by GitHub
commit 4a0dce67b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View file

@ -3654,12 +3654,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));
}
/**