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-18 13:54:55 +0200
commit60f6347c97994f2d62e7067944179c7791b7931b (patch)
tree8f06c6aaef8158136eae48994e569993bf85a178 /lib
parent3e94ee391f4ff5eae121dceb520cf7b6409b1f3d (diff)
downloadnextcloud-server-60f6347c97994f2d62e7067944179c7791b7931b.tar.gz
nextcloud-server-60f6347c97994f2d62e7067944179c7791b7931b.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 0a31250c477..631ebf5bc81 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -459,13 +459,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 {