From b7be79c5e7bfe25c3c55784733b6f616f18d85dc Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 13 Jun 2015 15:57:28 -0700 Subject: isolate the os_storage flag --- include/RedDAV/RedFile.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/RedDAV/RedFile.php') 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'); } -- cgit v1.2.3