Skip to content

Commit

Permalink
Fix File#putContents(string) on ObjectStorage
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr authored and Backportbot committed Jul 17, 2019
1 parent 7e954eb commit 2182251
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 2182251

Please sign in to comment.