Merge pull request #18009 from owncloud/enc_always_update_file_cache
let the encryption storage wrapper always update the file cache
This commit is contained in:
commit
af7bcb43b1
|
@ -127,12 +127,11 @@ class Encryption extends Wrapper {
|
||||||
$info = $this->getCache()->get($path);
|
$info = $this->getCache()->get($path);
|
||||||
if (isset($this->unencryptedSize[$fullPath])) {
|
if (isset($this->unencryptedSize[$fullPath])) {
|
||||||
$size = $this->unencryptedSize[$fullPath];
|
$size = $this->unencryptedSize[$fullPath];
|
||||||
|
// update file cache
|
||||||
if (isset($info['fileid'])) {
|
|
||||||
$info['encrypted'] = true;
|
$info['encrypted'] = true;
|
||||||
$info['size'] = $size;
|
$info['size'] = $size;
|
||||||
$this->getCache()->put($path, $info);
|
$this->getCache()->put($path, $info);
|
||||||
}
|
|
||||||
return $size;
|
return $size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,10 +261,12 @@ class Encryption extends \Test\Files\Storage\Storage {
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('copyKeys')
|
->method('copyKeys')
|
||||||
->willReturn($copyKeysReturn);
|
->willReturn($copyKeysReturn);
|
||||||
$this->cache->expects($this->once())
|
$this->cache->expects($this->atLeastOnce())
|
||||||
->method('put')
|
->method('put')
|
||||||
->with($this->anything(), ['encrypted' => true])
|
->willReturnCallback(function($path, $data) {
|
||||||
->willReturn(true);
|
$this->assertArrayHasKey('encrypted', $data);
|
||||||
|
$this->assertTrue($data['encrypted']);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$this->cache->expects($this->never())->method('put');
|
$this->cache->expects($this->never())->method('put');
|
||||||
$this->keyStore->expects($this->never())->method('copyKeys');
|
$this->keyStore->expects($this->never())->method('copyKeys');
|
||||||
|
|
Loading…
Reference in New Issue