summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-03-04 17:14:32 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-03-04 17:14:32 +0100
commitc8d1b294074db3813493090aee3056313a9c1425 (patch)
tree16af1584dbdce8c601e67afa64f2f7e924c11f28 /apps
parentdaee222534f3850e7689066e5391a7f3a9b9d452 (diff)
downloadnextcloud-server-c8d1b294074db3813493090aee3056313a9c1425.tar.gz
nextcloud-server-c8d1b294074db3813493090aee3056313a9c1425.zip
Do not just write foobar
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php9
1 files changed, 6 insertions, 3 deletions
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;