]> source.dussan.org Git - nextcloud-server.git/commitdiff
file_put_contents has to return the number of written bytes
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 1 Apr 2015 10:35:12 +0000 (12:35 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:30 +0000 (13:30 +0200)
lib/private/files/storage/wrapper/encryption.php

index 43052af8448b620d70e9cd5e634f2d9815ec0f8a..3e98098419160d7333328d43f78f94cfca715f98 100644 (file)
@@ -135,8 +135,9 @@ class Encryption extends Wrapper {
        public function file_put_contents($path, $data) {
                // file put content will always be translated to a stream write
                $handle = $this->fopen($path, 'w');
-               fwrite($handle, $data);
-               return fclose($handle);
+               $written = fwrite($handle, $data);
+               fclose($handle);
+               return $written;
        }
 
        /**
@@ -250,13 +251,8 @@ class Encryption extends Wrapper {
 
                if($shouldEncrypt === true && !$this->util->isExcluded($fullPath) && $encryptionModule !== null) {
                        $source = $this->storage->fopen($path, $mode);
-                       $uid = $this->uid;
-                       if (is_null($uid)) {
-                               list($owner, ) = $this->util->getUidAndFilename($fullPath);
-                               $uid = $owner;
-                       }
                        $handle = \OC\Files\Stream\Encryption::wrap($source, $path, $fullPath, $header,
-                               $uid, $encryptionModule, $this->storage, $this, $this->util, $this->fileHelper, $mode,
+                               $this->uid, $encryptionModule, $this->storage, $this, $this->util, $this->fileHelper, $mode,
                                $size, $unencryptedSize);
                        return $handle;
                } else {