aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Activity.php2
-rw-r--r--Zotlabs/Module/Item.php2
-rw-r--r--Zotlabs/Module/Like.php39
-rw-r--r--include/text.php2
4 files changed, 6 insertions, 39 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 014ff8949..d883eac67 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3042,7 +3042,7 @@ class Activity {
}
}
- if (array_key_exists('source',$act) && array_key_exists('mediaType',$act['source'])) {
+ if (array_path_exists('source/mediaType',$act) && array_path_exists('source/content',$act)) {
if ($act['source']['mediaType'] === 'text/bbcode') {
$content['bbcode'] = purify_html($act['source']['content']);
}
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 29563a9a5..d8c837522 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -816,8 +816,6 @@ class Item extends Controller {
$i = 0;
foreach($match[2] as $mtch) {
$reshare = new \Zotlabs\Lib\Share($mtch);
- $datarray['obj'] = $reshare->obj();
- $datarray['obj_type'] = $datarray['obj']['type'];
$body = str_replace($match[1][$i],$reshare->bbcode(),$body);
$i++;
}
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 61f73bfd5..edd4cfac8 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -210,20 +210,8 @@ class Like extends \Zotlabs\Web\Controller {
if(! $plink)
$plink = '[zrl=' . z_root() . '/profile/' . $ch[0]['channel_address'] . ']' . $post_type . '[/zrl]';
- $links = array();
- $links[] = array('rel' => 'alternate', 'type' => 'text/html',
- 'href' => z_root() . '/profile/' . $ch[0]['channel_address']);
- $links[] = array('rel' => 'photo', 'type' => $ch[0]['xchan_photo_mimetype'],
- 'href' => $ch[0]['xchan_photo_l']);
-
- $object = json_encode(array(
- 'type' => ACTIVITY_OBJ_PROFILE,
- 'title' => $ch[0]['channel_name'],
- 'id' => $ch[0]['xchan_url'] . '/' . $ch[0]['xchan_hash'],
- 'link' => $links
- ));
-
-
+ $object = json_encode(Activity::fetch_profile([ 'id' => channel_url($ch[0]) ]));
+
// second like of the same thing is "undo" for the first like
$z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target_id = '%s' limit 1",
@@ -408,27 +396,8 @@ class Like extends \Zotlabs\Web\Controller {
$body = $item['body'];
- $object = json_encode(array(
- 'type' => $objtype,
- 'id' => $item['mid'],
- 'asld' => Activity::fetch_item( [ 'id' => $item['mid'] ] ),
- 'parent' => (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_mid']),
- 'link' => $links,
- 'title' => $item['title'],
- 'content' => $item['body'],
- 'created' => $item['created'],
- 'edited' => $item['edited'],
- 'author' => array(
- 'name' => $item_author['xchan_name'],
- 'address' => $item_author['xchan_addr'],
- 'guid' => $item_author['xchan_guid'],
- 'guid_sig' => $item_author['xchan_guid_sig'],
- 'link' => array(
- array('rel' => 'alternate', 'type' => 'text/html', 'href' => $item_author['xchan_url']),
- array('rel' => 'photo', 'type' => $item_author['xchan_photo_mimetype'], 'href' => $item_author['xchan_photo_m'])),
- ),
- ));
-
+ $object = json_encode(Activity::fetch_item( [ 'id' => $item['mid'] ]));
+
if(! intval($item['item_thread_top']))
$post_type = 'comment';
diff --git a/include/text.php b/include/text.php
index 6873cc1c3..92e5807b4 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3751,7 +3751,7 @@ function array_path_exists($str,$arr) {
if($search) {
foreach($search as $s) {
- if(is_array($ptr) && array_key_exists($s,$ptr)) {
+ if ($ptr && is_array($ptr) && array_key_exists($s,$ptr)) {
$ptr = $ptr[$s];
}
else {