aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/ObjectStoreStorage.php
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 17:44:34 +0200
commit66837115162a7f722ee7e11e207cbc7a0ebf9d56 (patch)
tree8bb603068b0c245ed01a836562ba0b377d25f1c7 /lib/private/Files/ObjectStore/ObjectStoreStorage.php
parentf71dce6c9eaa785578b6cf68e1856f2872ad2a30 (diff)
downloadnextcloud-server-66837115162a7f722ee7e11e207cbc7a0ebf9d56.tar.gz
nextcloud-server-66837115162a7f722ee7e11e207cbc7a0ebf9d56.zip
fix: cleanup objectstore file_put_content
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore/ObjectStoreStorage.php')
-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 b510980f7fd..63fb0d92bb0 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -485,13 +485,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 {