aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-12 13:25:37 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-22 09:15:19 +0200
commitda892d69ab724354e1b3ee251e540ba306fffe44 (patch)
tree4eaf8ab4b94a6afa719013961eae5e198a2d4e47
parent01f3f8e0ccd13cb8e3e05e2c7adf08bdb13a11eb (diff)
downloadnextcloud-server-da892d69ab724354e1b3ee251e540ba306fffe44.tar.gz
nextcloud-server-da892d69ab724354e1b3ee251e540ba306fffe44.zip
if the file doesn't exists; create a new one. We use this to create new text files in the web interface
-rw-r--r--apps/files_external/lib/webdav.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index c2fe7c67b58..4869322d87a 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -234,7 +234,13 @@ class DAV extends \OC\Files\Storage\Common{
$mtime=time();
}
$path=$this->cleanPath($path);
- $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
+
+ // if file exists, update the mtime, else create a new empty file
+ if ($this->file_exists($path)) {
+ $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
+ } else {
+ $this->file_put_contents($path, '');
+ }
}
public function getFile($path, $target) {