diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-12-16 08:46:52 -0800 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-12-16 08:46:52 -0800 |
commit | 4ae148cebdbbab6291a77b62a0ecba2c6b92ae13 (patch) | |
tree | 7f7d0c041c07e3def96d5137b8db8ec6acd46b9b /apps/files_encryption/lib | |
parent | 28a28611fb9bf58bb949342cc105057f643dc1bf (diff) | |
parent | 95892c8be9c1e5a35e8f31e2ab34d233c69e6c35 (diff) | |
download | nextcloud-server-4ae148cebdbbab6291a77b62a0ecba2c6b92ae13.tar.gz nextcloud-server-4ae148cebdbbab6291a77b62a0ecba2c6b92ae13.zip |
Merge pull request #6183 from owncloud/enc_tests
enable more encryption tests
Diffstat (limited to 'apps/files_encryption/lib')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 5ba3bfa784f..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); @@ -182,8 +191,11 @@ class Proxy extends \OC_FileProxy { */ public function preUnlink($path) { - // let the trashbin handle this - if (\OCP\App::isEnabled('files_trashbin')) { + $relPath = Helper::stripUserFilesPath($path); + + // skip this method if the trash bin is enabled or if we delete a file + // outside of /data/user/files + if (\OCP\App::isEnabled('files_trashbin') || $relPath === false) { return true; } |