aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV/RedFile.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-11-06 15:58:56 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-11-06 15:58:56 +0100
commit5776af30e84356dade6b644a56dce2094ecb99eb (patch)
tree985a3325bdf75e341d70b2305c923dfbb2064972 /include/RedDAV/RedFile.php
parent91f751d10531e73078f7efb4efa1f5e215a8f871 (diff)
parent4ca0c2cfd14df5e2b6e9c7f59a10628f7653d6a4 (diff)
downloadvolse-hubzilla-5776af30e84356dade6b644a56dce2094ecb99eb.tar.gz
volse-hubzilla-5776af30e84356dade6b644a56dce2094ecb99eb.tar.bz2
volse-hubzilla-5776af30e84356dade6b644a56dce2094ecb99eb.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/RedDAV/RedFile.php')
-rw-r--r--include/RedDAV/RedFile.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php
index ec6871a69..2bc3f40e5 100644
--- a/include/RedDAV/RedFile.php
+++ b/include/RedDAV/RedFile.php
@@ -126,7 +126,11 @@ class RedFile extends DAV\Node implements DAV\IFile {
}
}
$fname = dbunescbin($d[0]['data']);
- $f = 'store/' . $this->auth->owner_nick . '/' . (($fname) ? $fname : '');
+ if(strpos($fname,'store') === false)
+ $f = 'store/' . $this->auth->owner_nick . '/' . (($fname) ? $fname : '');
+ else
+ $f = $fname;
+
// @todo check return value and set $size directly
@file_put_contents($f, $data);
$size = @filesize($f);
@@ -226,7 +230,11 @@ class RedFile extends DAV\Node implements DAV\IFile {
}
if (intval($r[0]['os_storage'])) {
- $f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . dbunescbin($r[0]['data']);
+ $x = dbunescbin($r[0]['data']);
+ if(strpos($x,'store') === false)
+ $f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . $x;
+ else
+ $f = $x;
return fopen($f, 'rb');
}
return dbunescbin($r[0]['data']);