aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-03-26 18:46:07 +0100
committerMario Vavti <mario@mariovavti.com>2016-03-26 18:46:07 +0100
commitf714e97d63e61dfda77f4d4ab4eb2b5b5fb06737 (patch)
treef1c439e3ca9d01f82a29629222e1afc603d194b8 /mod
parenta50706317435d09cacb95cad0a6ccaf8ae5b5f6c (diff)
parent3caf51b0754741dac2450a492de5aaebfa1b2fe9 (diff)
downloadvolse-hubzilla-f714e97d63e61dfda77f4d4ab4eb2b5b5fb06737.tar.gz
volse-hubzilla-f714e97d63e61dfda77f4d4ab4eb2b5b5fb06737.tar.bz2
volse-hubzilla-f714e97d63e61dfda77f4d4ab4eb2b5b5fb06737.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla
Diffstat (limited to 'mod')
-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'],