Check if partial cache entry or not in encryption wrapper

This commit is contained in:
Vincent Petry 2016-02-09 18:07:07 +01:00 committed by Lukas Reschke
parent 966eb4b084
commit 3736f13826
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}