summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-14 12:44:51 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-14 13:08:59 +0200
commit967e882757bdaf2f9703884f65dcd3c88530422c (patch)
tree3efeae557fdfdaac1d203482250d4495653089f2 /lib/private
parent387984a0d5fbe4ba2859300dc525df9b87917281 (diff)
downloadnextcloud-server-967e882757bdaf2f9703884f65dcd3c88530422c.tar.gz
nextcloud-server-967e882757bdaf2f9703884f65dcd3c88530422c.zip
return size from cache in case the cache entry is marked as encrypted
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 47a31e794e8..5697139bd6b 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -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);
+ if (isset($info['fileid'])) {
+ $info['encrypted'] = true;
+ $info['size'] = $size;
+ $this->getCache()->put($path, $info);
+ }
+ return $size;
}
- return $size;
+ if (isset($info['fileid']) && $info['encrypted']) {
+ return $info['size'];
+ }
+ return $this->storage->filesize($path);
}
/**