summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-12-16 15:24:11 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-12-16 16:05:24 +0100
commit95892c8be9c1e5a35e8f31e2ab34d233c69e6c35 (patch)
tree06378f96f6e6f4ecb2ed824a89028688ad0f0578
parentcdd816c930328f8ff721f9fa476184145eb3f41a (diff)
downloadnextcloud-server-95892c8be9c1e5a35e8f31e2ab34d233c69e6c35.tar.gz
nextcloud-server-95892c8be9c1e5a35e8f31e2ab34d233c69e6c35.zip
update file cache for target file
-rw-r--r--apps/files_encryption/lib/proxy.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 4a41c978139..96667493a51 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -114,6 +114,15 @@ class Proxy extends \OC_FileProxy {
// get encrypted content
$data = $view->file_get_contents($tmpPath);
+ // update file cache for target file
+ $tmpFileInfo = $view->getFileInfo($tmpPath);
+ $fileInfo = $view->getFileInfo($path);
+ if (is_array($fileInfo) && is_array($tmpFileInfo)) {
+ $fileInfo['encrypted'] = true;
+ $fileInfo['unencrypted_size'] = $tmpFileInfo['size'];
+ $view->putFileInfo($path, $fileInfo);
+ }
+
// remove our temp file
$view->deleteAll('/' . \OCP\User::getUser() . '/cache/' . $cacheFolder);