diff options
author | Björn Schießle <bjoern@schiessle.org> | 2014-11-07 16:20:42 +0100 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2014-11-07 16:20:42 +0100 |
commit | 68a522a8fab302942bfb259e6d00e53d931661e5 (patch) | |
tree | 765d62374722c958713d28fd69fc5c41e847086e /apps | |
parent | fa3b6192ec19340a626712d67710d5a2df691d60 (diff) | |
parent | 2af7256267c8b16efcf68fec45c612d8c64c0c1d (diff) | |
download | nextcloud-server-68a522a8fab302942bfb259e6d00e53d931661e5.tar.gz nextcloud-server-68a522a8fab302942bfb259e6d00e53d931661e5.zip |
Merge pull request #11736 from owncloud/enc_get_fileinfo_from_real_file
if we read a .part file we try to get the file info from the real file
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 4 | ||||
-rw-r--r-- | apps/files_encryption/lib/stream.php | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 31723ae7647..55f2df783c4 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -345,8 +345,8 @@ class Proxy extends \OC_FileProxy { return $size; } - // get file info from database/cache if not .part file - if (empty($fileInfo) && !Helper::isPartialFilePath($path)) { + // get file info from database/cache + if (empty($fileInfo)) { $proxyState = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; $fileInfo = $view->getFileInfo($path); diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index 046c38152b8..931aa08cb2c 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -637,13 +637,17 @@ class Stream { $path = Helper::stripPartialFileExtension($this->rawPath); $fileInfo = array( + 'mimetype' => $this->rootView->getMimeType($this->rawPath), 'encrypted' => true, - 'size' => $this->size, 'unencrypted_size' => $this->unencryptedSize, ); - // set fileinfo - $this->rootView->putFileInfo($path, $fileInfo); + // if we write a part file we also store the unencrypted size for + // the part file so that it can be re-used later + $this->rootView->putFileInfo($this->rawPath, $fileInfo); + if ($path !== $this->rawPath) { + $this->rootView->putFileInfo($path, $fileInfo); + } } |