fix: cleanup objectstore file_put_content

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-09-18 11:14:20 +02:00
parent 9b07b7d9c1
commit e8c7216d5b

View file

@ -462,13 +462,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 {