From 48c17d27453c1f0018b5b194496da2fb5189fdab Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 17 Jun 2015 19:44:57 +0200 Subject: only try to determine unencrypted size if a encrypted file is read --- apps/files_encryption/lib/proxy.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 07fd878f069..1277e689abe 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -299,7 +299,10 @@ class Proxy extends \OC_FileProxy { public function postGetFileInfo($path, $data) { // if path is a folder do nothing - if (\OCP\App::isEnabled('files_encryption') && $data !== false && array_key_exists('size', $data)) { + if (\OCP\App::isEnabled('files_encryption') && + $data !== false && + array_key_exists('size', $data) && + $this->shouldEncrypt($path)) { // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -330,7 +333,8 @@ class Proxy extends \OC_FileProxy { // if encryption is no longer enabled or if the files aren't migrated yet // we return the default file size if(!\OCP\App::isEnabled('files_encryption') || - $util->getMigrationStatus() !== Util::MIGRATION_COMPLETED) { + $util->getMigrationStatus() !== Util::MIGRATION_COMPLETED || + !$this->shouldEncrypt($path)) { return $size; } -- cgit v1.2.3