}
$uri = urldecode(Strings::escapeTags(trim($_GET['uri'])));
- if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/jrd+json') {
+ if (strpos($_SERVER['HTTP_ACCEPT'] ?? '', 'application/jrd+json') !== false) {
$mode = 'json';
} else {
$mode = 'xml';
}
$uri = urldecode(Strings::escapeTags(trim($_GET['resource'])));
- if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/xrd+xml') {
+ if (strpos($_SERVER['HTTP_ACCEPT'] ?? '', 'application/xrd+xml') !== false) {
$mode = 'xml';
} else {
$mode = 'json';
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => DI::baseUrl()->get() . '/follow?url={uri}',
],
+ [
+ 'rel' => ActivityNamespace::FEED,
+ 'type' => 'application/atom+xml',
+ 'href' => $owner['poll'] ?? DI::baseUrl()->get(),
+ ],
+ [
+ 'rel' => 'salmon',
+ 'href' => DI::baseUrl()->get() . '/salmon/' . $owner['nickname'],
+ ],
+ [
+ 'rel' => 'http://microformats.org/profile/hcard',
+ 'type' => 'text/html',
+ 'href' => DI::baseUrl()->get() . '/hcard/' . $owner['nickname'],
+ ],
+ [
+ 'rel' => 'http://joindiaspora.com/seed_location',
+ 'type' => 'text/html',
+ 'href' => DI::baseUrl()->get(),
+ ],
]
];
header('Access-Control-Allow-Origin: *');
{
$salmon_key = Salmon::salmonKey($owner['spubkey']);
- header('Access-Control-Allow-Origin: *');
- header('Content-type: application/json; charset=utf-8');
-
$json = [
'subject' => 'acct:' . $owner['addr'],
'aliases' => [
],
];
- echo json_encode($json);
- exit();
+ header('Access-Control-Allow-Origin: *');
+ System::jsonExit($json, 'application/jrd+json; charset=utf-8');
}
private static function printXML($alias, $baseURL, $user, $owner, $avatar)