From 0c8b04e141bf9faea1e5337409089e618b4a2fab Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 12 Feb 2026 14:53:55 +0100 Subject: [PATCH] fix(cache): filter out invalid entries in `OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById` Signed-off-by: Ferdinand Thiessen --- build/psalm-baseline.xml | 6 ------ lib/private/Files/Cache/Wrapper/CacheWrapper.php | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index e9f15ae817135..9b08cc9c28cea 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -3705,12 +3705,6 @@ cache instanceof Cache]]> - - - - - - diff --git a/lib/private/Files/Cache/Wrapper/CacheWrapper.php b/lib/private/Files/Cache/Wrapper/CacheWrapper.php index bf23f1cc30ab0..8d48fd2ddaa90 100644 --- a/lib/private/Files/Cache/Wrapper/CacheWrapper.php +++ b/lib/private/Files/Cache/Wrapper/CacheWrapper.php @@ -100,14 +100,14 @@ public function getFolderContents($folder) { } /** - * 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)); } /**