diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-02-18 14:25:57 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-02-18 14:25:57 +0100 |
commit | fc967a5ac2dee93376685d4fe9faababafe55491 (patch) | |
tree | 0e710806da2013715a59d2394ceda7fed4f1137c /apps/dav/lib/Connector/Sabre/File.php | |
parent | 3edffdd5818439f6b4710e50ba32972c875091ea (diff) | |
download | nextcloud-server-fc967a5ac2dee93376685d4fe9faababafe55491.tar.gz nextcloud-server-fc967a5ac2dee93376685d4fe9faababafe55491.zip |
Make sure that we have a stream
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/File.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/File.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 7767e83f508..388bcff9206 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -167,6 +167,13 @@ 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); + } + $isEOF = false; $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF) { $isEOF = feof($stream); |