Fix remote notices ids

This commit is contained in:
Diogo Cordeiro 2018-08-01 14:20:27 +01:00
parent ec49aee44b
commit db3ce1e34a
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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'];