t('ActivityPub Probe Diagnostic'), '$resource' => ['resource', t('Object URL'), $_REQUEST['resource'], EMPTY_STR], '$authf' => ['authf', t('Authenticated fetch'), $_REQUEST['authf'], EMPTY_STR, [t('No'), t('Yes')]], '$submit' => t('Submit') ]); if (x($_REQUEST, 'resource')) { $resource = $_REQUEST['resource']; if ($_REQUEST['authf']) { $channel = App::get_channel(); if (!$channel) { $channel = Channel::get_system(); } } $j = Activity::fetch($resource, $channel, false,true); if ($j) { $html .= '
' . str_replace('\\n', "\n", htmlspecialchars(json_encode($j, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT))) . '
'; } if (isset($j['type'])) { $AS = new ActivityStreams($j, null, true); if ($AS->is_valid() && isset($AS->data['type'])) { $html .= EOL . t('Eddsa-Signature: ') . (($AS->sigok) ? 'true' : 'false') . EOL. EOL; if (is_array($AS->obj) && isset($AS->obj['type']) && !str_contains($AS->obj['type'], 'Collection') && (!ActivityStreams::is_an_actor($j['type']))) { $item = Activity::decode_note($AS, true); if ($item) { $html .= '
' . str_replace('\\n', "\n", htmlspecialchars(json_encode($item, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT))) . '
'; $item['attach'] = json_encode($item['attach']); $items = [$item]; xchan_query($items); $html .= conversation($items, 'search', false, 'preview'); } } } } } return $html; } }