aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-09-18 11:14:20 +0200
committerRobin Appelman <robin@icewind.nl>2024-09-19 13:59:08 +0200
commite8c7216d5bf464ccf09dfc438f4c7c6ca9d4c2a8 (patch)
tree92d8e889dcde18fed78aeceb8e5b50c6d458846c /lib
parent9b07b7d9c1ff4db8094f8db0c661738c505e0310 (diff)
downloadnextcloud-server-e8c7216d5bf464ccf09dfc438f4c7c6ca9d4c2a8.tar.gz
nextcloud-server-e8c7216d5bf464ccf09dfc438f4c7c6ca9d4c2a8.zip
fix: cleanup objectstore file_put_content
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 1285e7ea177..faab6e74eb0 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -462,13 +462,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 {