]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix File#putContents(string) on ObjectStorage 16444/head
authorMarcel Klehr <mklehr@gmx.net>
Mon, 15 Jul 2019 21:51:02 +0000 (23:51 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Wed, 17 Jul 2019 20:39:24 +0000 (20:39 +0000)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
lib/private/Files/ObjectStore/ObjectStoreStorage.php

index 83a649e6084ef5366d2f3340497ec50d6e895ea8..9e042ffb396c02473d996a45e4ed1aedc5faa869 100644 (file)
@@ -410,10 +410,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
        }
 
        public function file_put_contents($path, $data) {
-               $stream = fopen('php://temp', 'r+');
-               fwrite($stream, $data);
-               rewind($stream);
-               return $this->writeStream($path, $stream, strlen($data)) > 0;
+               $handle = $this->fopen($path, 'w+');
+               fwrite($handle, $data);
+               fclose($handle);
+               return true;
        }
 
        public function writeStream(string $path, $stream, int $size = null): int {