summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-01 12:35:12 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:30 +0200
commit137c13566499beb70a099162919c02146136f020 (patch)
tree785b65ce6491e9037cbea75851693694db7009ae
parentf20844ac89f9c9d0860660b5cd5db352c6a38f80 (diff)
downloadnextcloud-server-137c13566499beb70a099162919c02146136f020.tar.gz
nextcloud-server-137c13566499beb70a099162919c02146136f020.zip
file_put_contents has to return the number of written bytes
-rw-r--r--lib/private/files/storage/wrapper/encryption.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 43052af8448..3e980984191 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -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 {