diff options
author | Robin Appelman <robin@icewind.nl> | 2024-09-18 11:14:20 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-09-19 13:59:08 +0200 |
commit | e8c7216d5bf464ccf09dfc438f4c7c6ca9d4c2a8 (patch) | |
tree | 92d8e889dcde18fed78aeceb8e5b50c6d458846c /lib | |
parent | 9b07b7d9c1ff4db8094f8db0c661738c505e0310 (diff) | |
download | nextcloud-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.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 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 { |