Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix File#putContents(string) on ObjectStorage
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr authored and Backportbot committed Jul 17, 2019
commit 21822512dccbdd9c2f5b8cfafc2cd7405544ad76
8 changes: 4 additions & 4 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ public function needsPartFile() {
}

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