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 committed by Louis
parent e794d04f57
commit e0f7dec5b6

View file

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