aboutsummaryrefslogtreecommitdiffstats
path: root/mod/xrd.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/xrd.php')
-rw-r--r--mod/xrd.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/xrd.php b/mod/xrd.php
index da4ab51a4..ed8e1eabe 100644
--- a/mod/xrd.php
+++ b/mod/xrd.php
@@ -7,8 +7,12 @@ function xrd_init(&$a) {
$uri = urldecode(notags(trim($_GET['uri'])));
logger('xrd: ' . $uri,LOGGER_DEBUG);
- if(substr($uri,0,4) === 'http')
+ $resource = $uri;
+
+ if(substr($uri,0,4) === 'http') {
+ $uri = str_replace('~','',$uri);
$name = basename($uri);
+ }
else {
$local = str_replace('acct:', '', $uri);
if(substr($local,0,2) == '//')
@@ -35,9 +39,18 @@ function xrd_init(&$a) {
header("Content-type: application/xrd+xml");
+ $aliases = array('acct:' . $r[0]['channel_address'] . '@' . $a->get_hostname(), z_root() . '/channel/' . $r[0]['channel_address'], z_root() . '/~' . $r[0]['channel_address']);
+
+ for($x = 0; $x < count($aliases); $x ++) {
+ if($aliases[$x] === $resource)
+ unset($aliases[$x]);
+ }
+
+
$o = replace_macros(get_markup_template('xrd_person.tpl'), array(
'$nick' => $r[0]['channel_address'],
- '$accturi' => $uri,
+ '$accturi' => $resource,
+ '$aliases' => $aliases,
'$profile_url' => $a->get_baseurl() . '/channel/' . $r[0]['channel_address'],
'$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['channel_address'],
'$atom' => $a->get_baseurl() . '/feed/' . $r[0]['channel_address'],