aboutsummaryrefslogtreecommitdiffstats
path: root/include/reddav.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/reddav.php')
-rw-r--r--include/reddav.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/reddav.php b/include/reddav.php
index b2683885d..a962d1bcc 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -321,15 +321,15 @@ class RedFile extends DAV\Node implements DAV\IFile {
function put($data) {
logger('RedFile::put: ' . basename($this->name), LOGGER_DEBUG);
-
$r = q("select flags, data from attach where hash = '%s' and uid = %d limit 1",
dbesc($hash),
intval($c[0]['channel_id'])
);
if($r) {
if($r[0]['flags'] & ATTACH_FLAG_OS) {
- @file_put_contents($r[0]['data'], $data);
- $size = @filesize($r[0]['data']);
+ $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] . '/' : '');
+ @file_put_contents($f, $data);
+ $size = @filesize($f);
}
else {
$r = q("update attach set data = '%s' where hash = '%s' and uid = %d limit 1",
@@ -886,7 +886,7 @@ class RedBrowser extends DAV\Browser\Plugin {
<td><a href=\"{$fullPath}\">{$displayName}</a></td>
<td>{$type}</td>
<td>{$size}</td>
- <td>" . datetime_convert('UTC', date_default_timezone_get(),$lastmodified) . "</td>
+ <td>" . (($lastmodified) ? datetime_convert('UTC', date_default_timezone_get(),$lastmodified) : '') . "</td>
</tr>";
}