aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-06-17 19:44:57 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-06-17 19:44:57 +0200
commit48c17d27453c1f0018b5b194496da2fb5189fdab (patch)
tree6a2dd27bc174ccdece2f274ad761ee9b6fc9bdc4
parent5fcab24e592c5f0f35d3293449dbd2f15a40f5f8 (diff)
downloadnextcloud-server-48c17d27453c1f0018b5b194496da2fb5189fdab.tar.gz
nextcloud-server-48c17d27453c1f0018b5b194496da2fb5189fdab.zip
only try to determine unencrypted size if a encrypted file is read
-rw-r--r--apps/files_encryption/lib/proxy.php8
1 files 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;
}