diff options
author | friendica <info@friendica.com> | 2014-01-06 18:13:02 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-06 18:13:02 -0800 |
commit | 5a5466346cccecec257fc20a993bfa2426b8bf48 (patch) | |
tree | d0dc294fdf33ac1c733d5d0fbdc272052822d187 /include/reddav.php | |
parent | 41df51a8151a5c1f35abe3c04f94e43b673e29ff (diff) | |
download | volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.gz volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.bz2 volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.zip |
prepare for OS file storage, and add bbcode attachment link to mod/filestorage. This isn't beautiful, but it's a start.
Diffstat (limited to 'include/reddav.php')
-rw-r--r-- | include/reddav.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/reddav.php b/include/reddav.php index 543cdfeac..05a93b9f8 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -376,11 +376,16 @@ class RedFile extends DAV\Node implements DAV\IFile { function get() { logger('RedFile::get: ' . basename($this->name)); - $r = q("select data from attach where hash = '%s' and uid = %d limit 1", + $r = q("select data, flags from attach where hash = '%s' and uid = %d limit 1", dbesc($this->data['hash']), intval($this->data['uid']) ); - if($r) return $r[0]['data']; + if($r) { + if($r[0]['flags'] & ATTACH_FLAG_OS ) { + return fopen($r[0]['data'],'rb'); + } + return $r[0]['data']; + } } |