Skip to content

Commit

Permalink
fix: cleanup objectstore file_put_content
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Sep 18, 2024
1 parent 7421455 commit 1e45425
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,10 @@ public function needsPartFile() {
}

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 {
Expand Down

0 comments on commit 1e45425

Please sign in to comment.