]> source.dussan.org Git - nextcloud-server.git/commitdiff
update file cache for target file
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 16 Dec 2013 14:24:11 +0000 (15:24 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 16 Dec 2013 15:05:24 +0000 (16:05 +0100)
apps/files_encryption/lib/proxy.php

index 4a41c978139f1ca3fc483271dd3ec66eb8358db2..96667493a516638c75979125dbd64d5f392b18ef 100644 (file)
@@ -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);