aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-14 19:43:00 -0700
committerFriendika <info@friendika.com>2011-04-14 19:43:00 -0700
commitb5ccb8e2055bf08d282ebb0cba2cac0d850fdc5a (patch)
treebfc079466afcf1a0000ba24d42657f1355c203a6
parentde131c9e58ac2b14380d145d643bf2bd902ae9dc (diff)
downloadvolse-hubzilla-b5ccb8e2055bf08d282ebb0cba2cac0d850fdc5a.tar.gz
volse-hubzilla-b5ccb8e2055bf08d282ebb0cba2cac0d850fdc5a.tar.bz2
volse-hubzilla-b5ccb8e2055bf08d282ebb0cba2cac0d850fdc5a.zip
ensure host xrd is correct, even if installed in subpath
-rw-r--r--boot.php2
-rw-r--r--include/hostxrd.php4
-rw-r--r--view/xrd_host.tpl8
3 files changed, 7 insertions, 7 deletions
diff --git a/boot.php b/boot.php
index 0dd1d3823..1ef80e515 100644
--- a/boot.php
+++ b/boot.php
@@ -290,7 +290,7 @@ class App {
if($this->cmd === '.well-known/host-meta') {
require_once('include/hostxrd.php');
- hostxrd($this->hostname);
+ hostxrd($this->get_baseurl());
// NOTREACHED
}
diff --git a/include/hostxrd.php b/include/hostxrd.php
index 9161b265c..987175c33 100644
--- a/include/hostxrd.php
+++ b/include/hostxrd.php
@@ -1,10 +1,10 @@
<?php
-function hostxrd($hostname) {
+function hostxrd($baseurl) {
header("Content-type: text/xml");
$tpl = file_get_contents('view/xrd_host.tpl');
- echo str_replace('$domain',$hostname,$tpl);
+ echo str_replace('$domain',$baseurl,$tpl);
session_write_close();
exit();
diff --git a/view/xrd_host.tpl b/view/xrd_host.tpl
index f843df31e..c6184e306 100644
--- a/view/xrd_host.tpl
+++ b/view/xrd_host.tpl
@@ -4,9 +4,9 @@
<hm:Host>$domain</hm:Host>
- <Link rel='lrdd' template='http://$domain/xrd/?uri={uri}' />
- <Link rel='acct-mgmt' href='http://$domain/amcd' />
- <Link rel='http://services.mozilla.com/amcd/0.1' href='http://$domain/amcd' />
+ <Link rel='lrdd' template='$domain/xrd/?uri={uri}' />
+ <Link rel='acct-mgmt' href='$domain/amcd' />
+ <Link rel='http://services.mozilla.com/amcd/0.1' href='$domain/amcd' />
<Link rel="http://oexchange.org/spec/0.8/rel/resident-target" type="application/xrd+xml"
- href="http://$domain/oexchange/xrd" />
+ href="$domain/oexchange/xrd" />
</XRD>