Skip to content

Commit e6620dd

Browse files
committedMay 28, 2019
dont use part files for dav writes when the target folder doesn't have create permissions
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 96e8927 commit e6620dd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎apps/dav/lib/Connector/Sabre/File.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ public function put($data) {
147147
if ($needsPartFile) {
148148
// mark file as partial while uploading (ignored by the scanner)
149149
$partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part';
150-
} else {
150+
151+
if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) {
152+
$needsPartFile = false;
153+
}
154+
}
155+
if (!$needsPartFile) {
151156
// upload file directly as the final path
152157
$partFilePath = $this->path;
153158

@@ -178,7 +183,7 @@ public function put($data) {
178183
}
179184

180185
$isEOF = false;
181-
$wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF) {
186+
$wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF) {
182187
$isEOF = feof($stream);
183188
});
184189

0 commit comments

Comments
 (0)