]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix - public sharing: in case on user is available - get it from the path
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 30 Mar 2015 19:44:28 +0000 (21:44 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:28 +0000 (13:30 +0200)
lib/private/files/storage/wrapper/encryption.php

index 8892194f32b275e4f5d9252013f7c4774cefed1a..cea7a38d41bb775ef7d1c697d046be7d5dbd8250 100644 (file)
@@ -244,8 +244,13 @@ 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,
-                               $this->uid, $encryptionModule, $this->storage, $this, $this->util, $mode,
+                               $uid, $encryptionModule, $this->storage, $this, $this->util, $mode,
                                $size, $unencryptedSize);
                        return $handle;
                } else {