From 19980be116a16a354919960ef2623d0c247c9c2b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 8 Feb 2016 20:57:20 +0100 Subject: Fix part file partial cache logic in encryption code The encryption code uses partial cache entries for the part file (which are not stored in the database) but are useful for other parts of the code to retrieve the file size again. This means that in the fixed code $info was empty, so getData() could not be called. The fix makes sure to support both cases when the cache entry exists and doesn't. --- lib/private/files/storage/wrapper/encryption.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/private/files/storage') diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 69438ef0c7c..f358bd59239 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -129,9 +129,15 @@ class Encryption extends Wrapper { if (isset($this->unencryptedSize[$fullPath])) { $size = $this->unencryptedSize[$fullPath]; // update file cache + if ($info) { + $info = $info->getData(); + } else { + $info = []; + } + $info['encrypted'] = true; $info['size'] = $size; - $this->getCache()->put($path, $info->getData()); + $this->getCache()->put($path, $info); return $size; } -- cgit v1.2.3