summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-30 16:07:41 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:28 +0200
commit0c48b069ba6cabe16522b72ac276ab266a326e9e (patch)
treef1276927a8b88292d84ad9dc4357ab1f69df98d1 /lib
parent498625ea3a9c5ad44597d39a8c4e1b1cdfe57929 (diff)
downloadnextcloud-server-0c48b069ba6cabe16522b72ac276ab266a326e9e.tar.gz
nextcloud-server-0c48b069ba6cabe16522b72ac276ab266a326e9e.zip
call end() before closing the file
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/stream/encryption.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index bd90f00825e..40cbc1c141a 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -363,7 +363,13 @@ class Encryption extends Wrapper {
public function stream_close() {
$this->flush();
- $this->encryptionStorage->updateUnencryptedSize($this->fullPath, $this->unencryptedSize);
+ $remainingData = $this->encryptionModule->end($this->fullPath);
+ if ($this->readOnly === false) {
+ if(!empty($remainingData)) {
+ parent::stream_write($remainingData);
+ }
+ $this->encryptionStorage->updateUnencryptedSize($this->fullPath, $this->unencryptedSize);
+ }
return parent::stream_close();
}