summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-06-02 12:04:46 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-04 07:55:45 +0200
commit3a698bce6e7def580eea5773a0b62d0fa25edc5e (patch)
tree6064d871e76516382736ecbeba08b9ecfd372809 /apps
parentcda87fd9c4e9d60bb20a9e4b80db5951dccc00e2 (diff)
downloadnextcloud-server-3a698bce6e7def580eea5773a0b62d0fa25edc5e.tar.gz
nextcloud-server-3a698bce6e7def580eea5773a0b62d0fa25edc5e.zip
don't ask for fileInfo if we already have one
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/lib/proxy.php9
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);