From f125be846c4e0b68bf687eecf12e64512dd40df0 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 10 Jan 2014 19:18:30 -0800 Subject: DAV put() issues --- include/reddav.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/reddav.php') diff --git a/include/reddav.php b/include/reddav.php index a6c550e2d..d80bcedde 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -321,13 +321,18 @@ class RedFile extends DAV\Node implements DAV\IFile { function put($data) { logger('RedFile::put: ' . basename($this->name), LOGGER_DEBUG); + + $c = q("select * from channel where channel_id = %d limit 1", + intval($this->auth->owner_id) + ); + $r = q("select flags, data from attach where hash = '%s' and uid = %d limit 1", dbesc($this->data['hash']), intval($c[0]['channel_id']) ); if($r) { if($r[0]['flags'] & ATTACH_FLAG_OS) { - $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] . '/' : ''); + $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] : ''); @file_put_contents($f, $data); $size = @filesize($f); logger('reddav: put() filename: ' . $f . ' size: ' . $size, LOGGER_DEBUG); -- cgit v1.2.3