diff options
author | Louis Chemineau <louis@chmn.me> | 2024-11-21 17:13:24 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-11-21 17:13:24 +0100 |
commit | f9cda54cbf5559372b0e9e22dac41483c18a6988 (patch) | |
tree | f59c974c784322a7d24675c38f9758b62a7d7961 /lib | |
parent | 16812837157395c078a9689cd51530a6382e17d2 (diff) | |
download | nextcloud-server-f9cda54cbf5559372b0e9e22dac41483c18a6988.tar.gz nextcloud-server-f9cda54cbf5559372b0e9e22dac41483c18a6988.zip |
fix: Wrap partial cache entry in CacheEntryartonge/fix/getting_cache_entry
Because it is returned here: https://github.com/nextcloud/server/blob/7b7d07c5750583ab3a7b29112af475f5c8891143/lib/private/Files/Cache/Cache.php#L136-L137
And some implementation got stricter: https://github.com/nextcloud/groupfolders/blob/df95bf6ba807da5171de91108879b6d8aa9f3611/lib/Mount/RootEntryCache.php#L23-L28
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 59d5a838d72..da798af46cd 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -249,14 +249,14 @@ class Cache implements ICache { $file = $this->normalize($file); if (isset($this->partial[$file])) { //add any saved partial data - $data = array_merge($this->partial[$file], $data); + $data = array_merge($this->partial[$file]->getData(), $data); unset($this->partial[$file]); } $requiredFields = ['size', 'mtime', 'mimetype']; foreach ($requiredFields as $field) { if (!isset($data[$field])) { //data not complete save as partial and return - $this->partial[$file] = $data; + $this->partial[$file] = new CacheEntry($data); return -1; } } |