From: Bjoern Schiessle Date: Mon, 30 Mar 2015 14:07:41 +0000 (+0200) Subject: call end() before closing the file X-Git-Tag: v8.1.0alpha1~78^2~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0c48b069ba6cabe16522b72ac276ab266a326e9e;p=nextcloud-server.git call end() before closing the file --- 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(); }