From: Thomas Müller Date: Tue, 14 Apr 2015 10:44:51 +0000 (+0200) Subject: return size from cache in case the cache entry is marked as encrypted X-Git-Tag: v8.1.0alpha1~14^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=967e882757bdaf2f9703884f65dcd3c88530422c;p=nextcloud-server.git return size from cache in case the cache entry is marked as encrypted --- 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); } /**