diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-07 11:25:29 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-07 14:59:09 +0100 |
commit | 48d63a6278078d164774fd182f03ebba5e3c77ad (patch) | |
tree | 892f4baee51b2d74560555609bc927c052b57d50 /apps/files_encryption/lib/proxy.php | |
parent | 7f24d42ca5f70e5ed48cf800f0a8f134b9445d2e (diff) | |
download | nextcloud-server-48d63a6278078d164774fd182f03ebba5e3c77ad.tar.gz nextcloud-server-48d63a6278078d164774fd182f03ebba5e3c77ad.zip |
Return unencrypted_size of folder when queried
This fixes the "used space" to be based on the unencrypted size, not
encrypted size, to be consistent with how quota/space is handled when
encryption is enabled
Diffstat (limited to 'apps/files_encryption/lib/proxy.php')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index a2d42c22c13..b7e1599c1fe 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -340,6 +340,13 @@ class Proxy extends \OC_FileProxy { // if path is a folder do nothing if ($view->is_dir($path)) { + $proxyState = \OC_FileProxy::$enabled; + \OC_FileProxy::$enabled = false; + $fileInfo = $view->getFileInfo($path); + \OC_FileProxy::$enabled = $proxyState; + if ($fileInfo['unencrypted_size'] > 0) { + return $fileInfo['unencrypted_size']; + } return $size; } |