summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-30 17:29:05 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:28 +0200
commit0eee3a2618235bcb59ce1bcb98526a7592de4578 (patch)
tree760c65a1a61f5dc928e8f80516fb9c58ea43040b /apps/files_sharing/lib
parentd185761d31f4845e9bf39dbbe0c61d199689deb7 (diff)
downloadnextcloud-server-0eee3a2618235bcb59ce1bcb98526a7592de4578.tar.gz
nextcloud-server-0eee3a2618235bcb59ce1bcb98526a7592de4578.zip
remove unencrypted_size from the cache, size will contain the unencrypted size
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/cache.php9
-rw-r--r--apps/files_sharing/lib/share/file.php7
2 files changed, 3 insertions, 13 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 69b8f629393..e9b2addea38 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -122,7 +122,7 @@ class Shared_Cache extends Cache {
}
$query = \OC_DB::prepare(
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
- . ' `size`, `mtime`, `encrypted`, `unencrypted_size`, `storage_mtime`, `etag`, `permissions`'
+ . ' `size`, `mtime`, `encrypted`, `storage_mtime`, `etag`, `permissions`'
. ' FROM `*PREFIX*filecache` WHERE `fileid` = ?');
$result = $query->execute(array($sourceId));
$data = $result->fetchRow();
@@ -135,12 +135,7 @@ class Shared_Cache extends Cache {
if ($data['storage_mtime'] === 0) {
$data['storage_mtime'] = $data['mtime'];
}
- if ($data['encrypted'] or ($data['unencrypted_size'] > 0 and $data['mimetype'] === 'httpd/unix-directory')) {
- $data['encrypted_size'] = (int)$data['size'];
- $data['size'] = (int)$data['unencrypted_size'];
- } else {
- $data['size'] = (int)$data['size'];
- }
+ $data['size'] = (int)$data['size'];
$data['permissions'] = (int)$data['permissions'];
if (!is_int($file) || $file === 0) {
$data['path'] = '';
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 22d6f29ff94..1822c2468f1 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -128,12 +128,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
$storage = \OC\Files\Filesystem::getStorage('/');
$cache = $storage->getCache();
- if ($item['encrypted'] or ($item['unencrypted_size'] > 0 and $cache->getMimetype($item['mimetype']) === 'httpd/unix-directory')) {
- $file['size'] = $item['unencrypted_size'];
- $file['encrypted_size'] = $item['size'];
- } else {
- $file['size'] = $item['size'];
- }
+ $file['size'] = $item['size'];
$files[] = $file;
}
return $files;