aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-26 17:25:58 -0700
committerMario Vavti <mario@mariovavti.com>2018-04-27 09:57:57 +0200
commit34fbcfdfaa70080b7c280ede2910f9a198a7ede2 (patch)
treec269879179eec2b3eb4164b291960a6de1ffba17
parenta85b1efa4fa935ebea18976d3ef2c08a538e4e89 (diff)
downloadvolse-hubzilla-34fbcfdfaa70080b7c280ede2910f9a198a7ede2.tar.gz
volse-hubzilla-34fbcfdfaa70080b7c280ede2910f9a198a7ede2.tar.bz2
volse-hubzilla-34fbcfdfaa70080b7c280ede2910f9a198a7ede2.zip
set the 'force' flag on attach_mkdir when initiated from a DAV operation. This will report success if it already exists rather than throwing an exception.
-rw-r--r--Zotlabs/Storage/Directory.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index a2ae0fee8..d063eed40 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -389,8 +389,12 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
);
if ($r) {
+
+ // When initiated from DAV, set the 'force' flag on attach_mkdir(). This will cause the operation to report success even if the
+ // folder already exists.
+
require_once('include/attach.php');
- $result = attach_mkdir($r[0], $this->auth->observer, array('filename' => $name, 'folder' => $this->folder_hash));
+ $result = attach_mkdir($r[0], $this->auth->observer, array('filename' => $name, 'folder' => $this->folder_hash, 'force' => true));
if($result['success']) {
$sync = attach_export_data($r[0],$result['data']['hash']);