From eb14a8fcba62dac7679b840fa410ef66ab0add28 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 15 Jul 2019 23:51:02 +0200 Subject: [PATCH] Fix File#putContents(string) on ObjectStorage Signed-off-by: Marcel Klehr --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 7ee1c8e2055..7cf164916a9 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 { -- 2.39.5