aboutsummaryrefslogtreecommitdiffstats
path: root/mod/xrd.php
diff options
context:
space:
mode:
authorAndrew Manning <andrew@reticu.li>2016-03-23 21:17:23 -0400
committerAndrew Manning <andrew@reticu.li>2016-03-23 21:17:23 -0400
commit59827b6dfdcab85b65853f3ee75365bda057a993 (patch)
treedc1871d3cba25d9064192d206bf24b16780621ab /mod/xrd.php
parent61bef7d4b083c9c794469137798176b62c2f21cb (diff)
parentf200dd4395e1d0e2a6200844ec4827a943bf09ea (diff)
downloadvolse-hubzilla-59827b6dfdcab85b65853f3ee75365bda057a993.tar.gz
volse-hubzilla-59827b6dfdcab85b65853f3ee75365bda057a993.tar.bz2
volse-hubzilla-59827b6dfdcab85b65853f3ee75365bda057a993.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla into contextual-help
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'],