aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-08-19 19:34:04 -0400
committerAndrew Manning <tamanning@zoho.com>2016-08-19 19:34:04 -0400
commitcf93d9c3b42a4ab1dd9c4199b3b0711cc41b2dbb (patch)
tree3bd937f447fc0a4e57c9e9b4a88074eabf0c1e5d /include/api.php
parent40a7d3821098c095a01e2a30b2b49c53bb38e2cf (diff)
parente4244c0cac301c63e5f69cde24c889e15500d89e (diff)
downloadvolse-hubzilla-cf93d9c3b42a4ab1dd9c4199b3b0711cc41b2dbb.tar.gz
volse-hubzilla-cf93d9c3b42a4ab1dd9c4199b3b0711cc41b2dbb.tar.bz2
volse-hubzilla-cf93d9c3b42a4ab1dd9c4199b3b0711cc41b2dbb.zip
Merge remote-tracking branch 'upstream/dev' into website-export
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/api.php b/include/api.php
index 043db5921..fb49da9df 100644
--- a/include/api.php
+++ b/include/api.php
@@ -118,11 +118,7 @@ require_once('include/api_auth.php');
break;
case "json":
header ("Content-Type: application/json");
- foreach($r as $rr) {
- if(! $rr)
- $rr = array();
- $json = json_encode($rr);
- }
+ $json = json_encode((is_array($r[0])) ? $r[0] : array());
// Lookup JSONP to understand these lines. They provide cross-domain AJAX ability.
if ($_GET['callback'])
$json = $_GET['callback'] . '(' . $json . ')' ;
@@ -137,9 +133,6 @@ require_once('include/api_auth.php');
return '<?xml version="1.0" encoding="UTF-8"?>'."\n".$r;
break;
case "as":
- //header ("Content-Type: application/json");
- //foreach($r as $rr)
- // return json_encode($rr);
return json_encode($r);
break;