diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-10-13 16:19:25 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-10-13 16:19:25 -0700 |
commit | edeba4ca34d167c96346077d5ff936666ebea709 (patch) | |
tree | c21019d2a6fd71f1ea9821c20b26b0ab82acd496 /include/api.php | |
parent | 7e03f612b3e814d209b94712103d535fabe7ae91 (diff) | |
parent | 578f1b8ece49c6b8aa8eb34e33f37f456d5a4d90 (diff) | |
download | volse-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.php | 7 |
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'])); |