Skip to content

Commit

Permalink
Merge pull request #16445 from nextcloud/backport/16440/stable15
Browse files Browse the repository at this point in the history
[stable15] Fix File#putContents(string) on ObjectStorage
  • Loading branch information
rullzer authored Jul 18, 2019
2 parents 788d727 + eb14a8f commit fb60ef6
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 fb60ef6

Please sign in to comment.