diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-09 18:07:07 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 23:43:27 +0100 |
commit | 3736f1382632716102ab2c99a1028ba7bdede5f4 (patch) | |
tree | c807a213117cbe81ed35ed619fe537c5500a7476 /lib/private/files | |
parent | 966eb4b0844aff453a48bcad7b342854f531f500 (diff) | |
download | nextcloud-server-3736f1382632716102ab2c99a1028ba7bdede5f4.tar.gz nextcloud-server-3736f1382632716102ab2c99a1028ba7bdede5f4.zip |
Check if partial cache entry or not in encryption wrapper
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 3307599aa52..14d3b15bbae 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -39,6 +39,7 @@ use OCP\Encryption\Keys\IStorage; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage; use OCP\ILogger; +use OCP\Files\Cache\ICacheEntry; class Encryption extends Wrapper { @@ -129,11 +130,13 @@ class Encryption extends Wrapper { if (isset($this->unencryptedSize[$fullPath])) { $size = $this->unencryptedSize[$fullPath]; // update file cache - if ($info) { + if ($info instanceof ICacheEntry) { $info = $info->getData(); $info['encrypted'] = $info['encryptedVersion']; } else { - $info = []; + if (!is_array($info)) { + $info = []; + } $info['encrypted'] = true; } |