diff options
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 0a31250c477..631ebf5bc81 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -459,13 +459,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil } public function file_put_contents($path, $data) { - $handle = $this->fopen($path, 'w+'); - if (!$handle) { - return false; - } - $result = fwrite($handle, $data); - fclose($handle); - return $result; + $fh = fopen('php://temp', 'w+'); + fwrite($fh, $data); + rewind($fh); + return $this->writeStream($path, $fh, strlen($data)); } public function writeStream(string $path, $stream, ?int $size = null): int { |