aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
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')
-rw-r--r--include/api.php9
-rw-r--r--include/channel.php2
-rwxr-xr-xinclude/items.php10
3 files changed, 8 insertions, 13 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;
diff --git a/include/channel.php b/include/channel.php
index 62c35e3ff..1179697a4 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -936,7 +936,7 @@ function profile_load($nickname, $profile = '') {
* load/reload current theme info
*/
- $_SESSION['theme'] = $p[0]['channel_theme'];
+// $_SESSION['theme'] = $p[0]['channel_theme'];
}
diff --git a/include/items.php b/include/items.php
index 0373dcb0d..91110eb07 100755
--- a/include/items.php
+++ b/include/items.php
@@ -695,8 +695,9 @@ function get_item_elements($x,$allow_code = false) {
// hub and verify that they are legit - or else we're going to toss the post. We only need to do this
// once, and after that your hub knows them. Sure some info is in the post, but it's only a transit identifier
// and not enough info to be able to look you up from your hash - which is the only thing stored with the post.
-
- if(($xchan_hash = import_author_xchan($x['author'])) !== false)
+
+ $xchan_hash = import_author_xchan($x['author']);
+ if($xchan_hash)
$arr['author_xchan'] = $xchan_hash;
else
return array();
@@ -705,7 +706,8 @@ function get_item_elements($x,$allow_code = false) {
if($arr['author_xchan'] === make_xchan_hash($x['owner']['guid'],$x['owner']['guid_sig']))
$arr['owner_xchan'] = $arr['author_xchan'];
else {
- if(($xchan_hash = import_author_xchan($x['owner'])) !== false)
+ $xchan_hash = import_author_xchan($x['owner']);
+ if($xchan_hash)
$arr['owner_xchan'] = $xchan_hash;
else
return array();
@@ -1166,7 +1168,7 @@ function encode_item_xchan($xchan) {
$ret['name'] = $xchan['xchan_name'];
$ret['address'] = $xchan['xchan_addr'];
- $ret['url'] = (($xchan['hubloc_url']) ? $xchan['hubloc_url'] : $xchan['xchan_url']);
+ $ret['url'] = $xchan['xchan_url'];
$ret['network'] = $xchan['xchan_network'];
$ret['photo'] = array('mimetype' => $xchan['xchan_photo_mimetype'], 'src' => $xchan['xchan_photo_m']);
$ret['guid'] = $xchan['xchan_guid'];