diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-04 10:26:02 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-04 10:26:02 +0200 |
commit | 4ab77f90d2645f503f077903020c6bd56415294a (patch) | |
tree | 621250352a8da7db1112f08b1bcaf7b4b3676b0e /apps/files_encryption/lib | |
parent | 9e31118675d425b99eff340ec7517e478ebc9fcf (diff) | |
parent | 917f389747dc3b8b3d5b9ff326a2cee21579f58a (diff) | |
download | nextcloud-server-4ab77f90d2645f503f077903020c6bd56415294a.tar.gz nextcloud-server-4ab77f90d2645f503f077903020c6bd56415294a.zip |
Merge pull request #8662 from owncloud/f-lock
f-lock
Diffstat (limited to 'apps/files_encryption/lib')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index ae3df834e9f..fd91073b8de 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -275,7 +275,7 @@ class Proxy extends \OC_FileProxy { \OC_FileProxy::$enabled = false; // get file size - $data['size'] = self::postFileSize($path, $data['size']); + $data['size'] = self::postFileSize($path, $data['size'], $data); // Re-enable the proxy \OC_FileProxy::$enabled = $proxyStatus; @@ -289,7 +289,7 @@ class Proxy extends \OC_FileProxy { * @param int $size * @return int|bool */ - public function postFileSize($path, $size) { + public function postFileSize($path, $size, $fileInfo = null) { $view = new \OC\Files\View('/'); @@ -323,9 +323,8 @@ class Proxy extends \OC_FileProxy { return $size; } - $fileInfo = false; // get file info from database/cache if not .part file - if (!Helper::isPartialFilePath($path)) { + if (empty($fileInfo) && !Helper::isPartialFilePath($path)) { $proxyState = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; $fileInfo = $view->getFileInfo($path); @@ -333,7 +332,7 @@ class Proxy extends \OC_FileProxy { } // if file is encrypted return real file size - if ($fileInfo && $fileInfo['encrypted'] === true) { + if (isset($fileInfo['encrypted']) && $fileInfo['encrypted'] === true) { // try to fix unencrypted file size if it doesn't look plausible if ((int)$fileInfo['size'] > 0 && (int)$fileInfo['unencrypted_size'] === 0 ) { $fixSize = $util->getFileSize($path); |