diff options
author | Robin Appelman <robin@icewind.nl> | 2024-09-18 11:14:20 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-09-19 17:44:34 +0200 |
commit | 66837115162a7f722ee7e11e207cbc7a0ebf9d56 (patch) | |
tree | 8bb603068b0c245ed01a836562ba0b377d25f1c7 /lib/private/Files/ObjectStore/ObjectStoreStorage.php | |
parent | f71dce6c9eaa785578b6cf68e1856f2872ad2a30 (diff) | |
download | nextcloud-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.php | 11 |
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 { |