summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper/encryption.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/storage/wrapper/encryption.php')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index c42e6d439fd..f7759d91497 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -206,8 +206,7 @@ class Encryption extends Wrapper {
$encryptionModule = $this->getEncryptionModule($path);
if ($encryptionModule) {
- $this->keyStorage->deleteAllFileKeys($this->getFullPath($path),
- $encryptionModule->getId());
+ $this->keyStorage->deleteAllFileKeys($this->getFullPath($path));
}
return $this->storage->unlink($path);
@@ -239,6 +238,21 @@ class Encryption extends Wrapper {
}
/**
+ * see http://php.net/manual/en/function.rmdir.php
+ *
+ * @param string $path
+ * @return bool
+ */
+ public function rmdir($path) {
+ $result = $this->storage->rmdir($path);
+ if ($result && $this->encryptionManager->isEnabled()) {
+ $this->keyStorage->deleteAllFileKeys($this->getFullPath($path));
+ }
+
+ return $result;
+ }
+
+ /**
* see http://php.net/manual/en/function.copy.php
*
* @param string $path1
@@ -269,8 +283,13 @@ class Encryption extends Wrapper {
}
}
$data = $this->getMetaData($path1);
- $this->getCache()->put($path2, ['encrypted' => $data['encrypted']]);
- $this->updateUnencryptedSize($fullPath2, $data['size']);
+
+ if (isset($data['encrypted'])) {
+ $this->getCache()->put($path2, ['encrypted' => $data['encrypted']]);
+ }
+ if (isset($data['size'])) {
+ $this->updateUnencryptedSize($fullPath2, $data['size']);
+ }
}
return $result;