From db3ce1e34ae70a781839e5f50098f0b21933e5e1 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Wed, 1 Aug 2018 14:20:27 +0100 Subject: [PATCH] Fix remote notices ids --- actions/inbox/Create.php | 6 +++--- utils/explorer.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actions/inbox/Create.php b/actions/inbox/Create.php index 5d549a1..d6fee04 100755 --- a/actions/inbox/Create.php +++ b/actions/inbox/Create.php @@ -66,7 +66,7 @@ if (isset($data->object->inReplyTo)) { try { $inReplyTo = ActivityPubPlugin::get_local_notice_from_url($data->object->inReplyTo); } catch (Exception $e) { - ActivityPubReturn::error("Invalid Object inReplyTo value."); + ActivityPubReturn::error('Invalid Object inReplyTo value.'); } $act->context->replyToID = $inReplyTo->getUri(); $act->context->replyToUrl = $inReplyTo->getUrl(); @@ -104,7 +104,7 @@ if (isset($data->object->cc) && is_array($data->object->cc)) { unset($discovery); foreach ($to_profiles as $tp) { - $act->context->attention[ActivityPubPlugin::actor_uri($tp)] = "http://activitystrea.ms/schema/1.0/person"; + $act->context->attention[ActivityPubPlugin::actor_uri($tp)] = 'http://activitystrea.ms/schema/1.0/person'; } // Add location if that is set @@ -117,7 +117,7 @@ if (Notice::contentTooLong($content)) { ActivityPubReturn::error("That's too long. Maximum notice size is %d character."); } -$options = array('source' => 'ActivityPub', 'uri' => isset($data->id) ? $data->id : $data->object->id, 'url' => $data->object->url); +$options = array('source' => 'ActivityPub', 'uri' => $data->object->id, 'url' => $data->object->url); // $options gets filled with possible scoping settings ToSelector::fillActivity($this, $act, $options); diff --git a/utils/explorer.php b/utils/explorer.php index 7779497..f010878 100755 --- a/utils/explorer.php +++ b/utils/explorer.php @@ -228,7 +228,7 @@ class Activitypub_explorer $aprofile->uri = $res['id']; $aprofile->nickname = $res['preferredUsername']; $aprofile->fullname = isset($res['name']) ? $res['name'] : null; - $aprofile->bio = isset($res['summary']) ? substr($res['summary'], 0, 1000) : null; + $aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null; $aprofile->inboxuri = $res['inbox']; $aprofile->sharedInboxuri = isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : $res['inbox'];