]> source.dussan.org Git - nextcloud-server.git/commitdiff
Hanlde writestream not closing source 14299/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 20 Feb 2019 08:49:06 +0000 (09:49 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 20 Feb 2019 08:49:06 +0000 (09:49 +0100)
Fixes #14298

If a storage doesn'tclose the write stream then $isEOF is not yet set.
So we have to fallback.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Connector/Sabre/File.php

index 388bcff92065d104fc4ea4a498b8ae929b1085f9..8aa7d66ba34b5bfacd8d1e129d5a27b217ab21d4 100644 (file)
@@ -181,8 +181,12 @@ class File extends Node implements IFile {
 
                                $count = $partStorage->writeStream($internalPartPath, $wrappedData);
                                $result = $count > 0;
+
                                if ($result === false) {
                                        $result = $isEOF;
+                                       if (is_resource($wrappedData)) {
+                                               $result = feof($wrappedData);
+                                       }
                                }
 
                        } else {