]> source.dussan.org Git - nextcloud-server.git/commitdiff
call end() before closing the file
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 30 Mar 2015 14:07:41 +0000 (16:07 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:28 +0000 (13:30 +0200)
lib/private/files/stream/encryption.php

index bd90f00825e8e5ecd98c90d73de388c48efb337c..40cbc1c141a2f2a84a4578e48b8e3b93fcbf4d90 100644 (file)
@@ -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();
        }