From 6098bd485166d259b7cdfc9a97c3b7135bbffe02 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Fri, 30 Jun 2017 16:41:49 +0100 Subject: [PATCH] Handle incomplete filecache entries --- lib/private/Files/Cache/Cache.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index bcd0226a3ee1..5430528b0346 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -135,12 +135,7 @@ public function get($file) { } //merge partial data - if (!$data and is_string($file)) { - if (isset($this->partial[$file])) { - $data = $this->partial[$file]; - } - return $data; - } else { + if($data) { //fix types $data['fileid'] = (int)$data['fileid']; $data['parent'] = (int)$data['parent']; @@ -157,6 +152,13 @@ public function get($file) { } $data['permissions'] = (int)$data['permissions']; return new CacheEntry($data); + } else if (!$data and is_string($file)) { + if (isset($this->partial[$file])) { + $data = $this->partial[$file]; + } + return $data; + } else { + return false; } }