From c8d1b294074db3813493090aee3056313a9c1425 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 4 Mar 2019 17:14:32 +0100 Subject: Do not just write foobar Signed-off-by: Roeland Jago Douma --- apps/dav/lib/Connector/Sabre/File.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 8aa7d66ba34..d2d9420292f 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -169,9 +169,12 @@ class File extends Node implements IFile { if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) { if (!is_resource($data)) { - $data = fopen('php://temp', 'r+'); - fwrite($data, 'foobar'); - rewind($data); + $tmpData = fopen('php://temp', 'r+'); + if ($data !== null) { + fwrite($tmpData, $data); + rewind($tmpData); + } + $data = $tmpData; } $isEOF = false; -- cgit v1.2.3