aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-13 16:19:25 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-13 16:19:25 -0700
commitedeba4ca34d167c96346077d5ff936666ebea709 (patch)
treec21019d2a6fd71f1ea9821c20b26b0ab82acd496 /include/api.php
parent7e03f612b3e814d209b94712103d535fabe7ae91 (diff)
parent578f1b8ece49c6b8aa8eb34e33f37f456d5a4d90 (diff)
downloadvolse-hubzilla-edeba4ca34d167c96346077d5ff936666ebea709.tar.gz
volse-hubzilla-edeba4ca34d167c96346077d5ff936666ebea709.tar.bz2
volse-hubzilla-edeba4ca34d167c96346077d5ff936666ebea709.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts: include/api.php
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/api.php b/include/api.php
index b8e0582a6..d0449763b 100644
--- a/include/api.php
+++ b/include/api.php
@@ -622,7 +622,7 @@ require_once('include/attach.php');
function api_attach_list(&$a,$type) {
logger('api_user: ' . api_user());
- json_return_and_die(attach_list_files(api_user(),get_observer_hash()));
+ json_return_and_die(attach_list_files(api_user(),get_observer_hash(),'','','','created asc'));
}
api_register_func('api/red/files','api_attach_list', true);
@@ -635,8 +635,9 @@ require_once('include/attach.php');
dbesc($_REQUEST['file_id'])
);
if($r) {
- $data = dbunescbin($r[0]['data']);
- if(intval($r[0]['os_storage']))
+ if($r[0]['is_dir'])
+ $r[0]['data'] = '';
+ elseif(intval($r[0]['os_storage']))
$r[0]['data'] = base64_encode(file_get_contents(dbunescbin($r[0]['data'])));
else
$r[0]['data'] = base64_encode(dbunescbin($r[0]['data']));