diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-08 20:57:20 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 09:47:34 +0100 |
commit | 19980be116a16a354919960ef2623d0c247c9c2b (patch) | |
tree | cfe2fa18a654ff33cca2eba8e7f92f9a5f227067 /lib/private/files/storage | |
parent | 98497aa423f494da8b0971f995854b2507e7ebb4 (diff) | |
download | nextcloud-server-19980be116a16a354919960ef2623d0c247c9c2b.tar.gz nextcloud-server-19980be116a16a354919960ef2623d0c247c9c2b.zip |
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.
Diffstat (limited to 'lib/private/files/storage')
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |