aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/api.php b/include/api.php
index 4ad915c03..fd6883f44 100644
--- a/include/api.php
+++ b/include/api.php
@@ -112,8 +112,11 @@ require_once('include/api_auth.php');
break;
case "json":
header ("Content-Type: application/json");
- foreach($r as $rr)
+ foreach($r as $rr) {
+ if(! $rr)
+ $rr = array();
$json = json_encode($rr);
+ }
if ($_GET['callback'])
$json = $_GET['callback']."(".$json.")";
return $json;
@@ -870,6 +873,7 @@ require_once('include/api_auth.php');
// this should output the last post (the one we just posted).
return api_status_show($a,$type);
}
+ api_register_func('api/statuses/update_with_media','api_statuses_update', true);
api_register_func('api/statuses/update','api_statuses_update', true);
@@ -1078,6 +1082,8 @@ require_once('include/api_auth.php');
'contributors' => ''
);
$status_info['user'] = $user_info;
+ if(array_key_exists('status',$status_info['user']))
+ unset($status_info['user']['status']);
}
return api_apply_template("status", $type, array('$status' => $status_info));
@@ -1319,6 +1325,8 @@ require_once('include/api_auth.php');
// params
$id = intval(argv(3));
+ if(! $id)
+ $id = $_REQUEST['id'];
logger('API: api_statuses_show: '.$id);
@@ -1335,10 +1343,12 @@ require_once('include/api_auth.php');
$r = q("select * from item where true $item_normal $sql_extra",
intval($id)
);
+
xchan_query($r,true);
$ret = api_format_items($r,$user_info);
+
if ($conversation) {
$data = array('$statuses' => $ret);
return api_apply_template("timeline", $type, $data);