diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-07-17 22:38:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-17 22:38:41 +0200 |
commit | 48653d1a27ef2cc9949b4f6b0c2e3dd99c765608 (patch) | |
tree | 8c43f472ec18a48be37ce5ed0ca232b5e3acc0df | |
parent | 5b604eaeaba7d5ee5dd12a92f37c9e8e7519c9c2 (diff) | |
parent | d46744e2f147afa1baafeaae70b744e177c3e5f7 (diff) | |
download | nextcloud-server-48653d1a27ef2cc9949b4f6b0c2e3dd99c765608.tar.gz nextcloud-server-48653d1a27ef2cc9949b4f6b0c2e3dd99c765608.zip |
Merge pull request #16440 from marcelklehr/fix/objectstorage-put-contents
Fix File#putContents(string) on ObjectStorage
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 681e45ad3f2..fbfbcfaa409 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -410,10 +410,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { } public function file_put_contents($path, $data) { - $stream = fopen('php://temp', 'r+'); - fwrite($stream, $data); - rewind($stream); - return $this->writeStream($path, $stream, strlen($data)) > 0; + $handle = $this->fopen($path, 'w+'); + fwrite($handle, $data); + fclose($handle); + return true; } public function writeStream(string $path, $stream, int $size = null): int { |