Fix File#putContents(string) on ObjectStorage

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2019-07-15 23:51:02 +02:00 committed by Backportbot
parent 7e954ebca0
commit 21822512dc

View file

@ -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 {