summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-09-21 14:13:04 +0200
committerRobin Appelman <robin@icewind.nl>2015-09-21 14:13:04 +0200
commitb23a5e6886e75a2d5b1a058b91c4ee2e89bb2635 (patch)
tree25182f46bfbb71f6c904b101ec63913c30bb6ee6 /lib
parentb520a1e5203763adfa354428d2cd924ee7ee86e5 (diff)
parent4ecf710dcd071f0282d54a5a3cf59102790da69f (diff)
downloadnextcloud-server-b23a5e6886e75a2d5b1a058b91c4ee2e89bb2635.tar.gz
nextcloud-server-b23a5e6886e75a2d5b1a058b91c4ee2e89bb2635.zip
Merge pull request #17347 from owncloud/dav-fopen-overwrite
dont download the existing file for webdav if we're going to overwrite it
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/dav.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index c1cf17abdee..171afd649c6 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -370,6 +370,7 @@ class DAV extends Common {
case 'c':
case 'c+':
//emulate these
+ $tempManager = \OC::$server->getTempManager();
if (strrpos($path, '.') !== false) {
$ext = substr($path, strrpos($path, '.'));
} else {
@@ -379,12 +380,16 @@ class DAV extends Common {
if (!$this->isUpdatable($path)) {
return false;
}
- $tmpFile = $this->getCachedFile($path);
+ if ($mode === 'w' or $mode === 'w+') {
+ $tmpFile = $tempManager->getTemporaryFile($ext);
+ } else {
+ $tmpFile = $this->getCachedFile($path);
+ }
} else {
if (!$this->isCreatable(dirname($path))) {
return false;
}
- $tmpFile = Files::tmpFile($ext);
+ $tmpFile = $tempManager->getTemporaryFile($ext);
}
Close::registerCallback($tmpFile, array($this, 'writeBack'));
self::$tempFiles[$tmpFile] = $path;