aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV/RedFile.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-13 15:57:28 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-13 15:57:28 -0700
commitb7be79c5e7bfe25c3c55784733b6f616f18d85dc (patch)
treefd7ca742398ee28c5ec754abb26e8348a8e85a69 /include/RedDAV/RedFile.php
parent3f0009ccd7fb96e8808b3267367ae95ffee37161 (diff)
downloadvolse-hubzilla-b7be79c5e7bfe25c3c55784733b6f616f18d85dc.tar.gz
volse-hubzilla-b7be79c5e7bfe25c3c55784733b6f616f18d85dc.tar.bz2
volse-hubzilla-b7be79c5e7bfe25c3c55784733b6f616f18d85dc.zip
isolate the os_storage flag
Diffstat (limited to 'include/RedDAV/RedFile.php')
-rw-r--r--include/RedDAV/RedFile.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php
index b7aa5473a..3a3cb2347 100644
--- a/include/RedDAV/RedFile.php
+++ b/include/RedDAV/RedFile.php
@@ -102,12 +102,12 @@ class RedFile extends DAV\Node implements DAV\IFile {
intval(PAGE_REMOVED)
);
- $r = q("SELECT flags, folder, data FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
+ $r = q("SELECT flags, folder, os_storage, 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) {
+ if (intval($r[0]['os_storage'])) {
$fname = dbunescbin($r[0]['data']);
$f = 'store/' . $this->auth->owner_nick . '/' . (($fname) ? $fname : '');
// @todo check return value and set $size directly
@@ -179,7 +179,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
public function get() {
logger('get file ' . basename($this->name), LOGGER_DEBUG);
- $r = q("SELECT data, flags, filename, filetype FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
+ $r = q("SELECT data, flags, os_storage, filename, filetype FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
dbesc($this->data['hash']),
intval($this->data['uid'])
);
@@ -192,7 +192,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
header('Content-type: text/plain');
}
- if ($r[0]['flags'] & ATTACH_FLAG_OS ) {
+ if (intval($r[0]['os_storage'])) {
$f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . dbunescbin($r[0]['data']);
return fopen($f, 'rb');
}