return size from cache in case the cache entry is marked as encrypted
This commit is contained in:
parent
387984a0d5
commit
967e882757
1 changed files with 10 additions and 8 deletions
|
@ -91,21 +91,23 @@ class Encryption extends Wrapper {
|
|||
*/
|
||||
public function filesize($path) {
|
||||
$fullPath = $this->getFullPath($path);
|
||||
$size = $this->storage->filesize($path);
|
||||
|
||||
$info = $this->getCache()->get($path);
|
||||
|
||||
if (isset($this->unencryptedSize[$fullPath])) {
|
||||
$size = $this->unencryptedSize[$fullPath];
|
||||
|
||||
if (isset($info['fileid'])) {
|
||||
$info['encrypted'] = true;
|
||||
$info['size'] = $size;
|
||||
$this->getCache()->put($path, $info);
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
|
||||
if (isset($info['fileid'])) {
|
||||
$info['encrypted'] = true;
|
||||
$info['size'] = $size;
|
||||
$this->getCache()->put($path, $info);
|
||||
if (isset($info['fileid']) && $info['encrypted']) {
|
||||
return $info['size'];
|
||||
}
|
||||
|
||||
return $size;
|
||||
return $this->storage->filesize($path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue