Skip to content

Commit

Permalink
fix: Wrap partial cache entry in CacheEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
artonge committed Nov 21, 2024
1 parent 1681283 commit b0c87ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@ public function insert($file, array $data) {
$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;
}
}
Expand Down

0 comments on commit b0c87ad

Please sign in to comment.