Skip to content
Snippets Groups Projects
Unverified Commit 48653d1a authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #16440 from marcelklehr/fix/objectstorage-put-contents

Fix File#putContents(string) on ObjectStorage
parents 5b604eae d46744e2
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment