]> git.mxchange.org Git - friendica.git/commitdiff
ensure host xrd is correct, even if installed in subpath
authorFriendika <info@friendika.com>
Fri, 15 Apr 2011 02:43:00 +0000 (19:43 -0700)
committerFriendika <info@friendika.com>
Fri, 15 Apr 2011 02:43:00 +0000 (19:43 -0700)
boot.php
include/hostxrd.php
view/xrd_host.tpl

index 0dd1d382341a661c2640161ec30d93ff30ede33b..1ef80e515d75a0a1038a71341b4084f12611766d 100644 (file)
--- 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
                }
 
index 9161b265caecebfbb62f18a5ddec31b80e600648..987175c33164ff7336c9a53259409ab70168314d 100644 (file)
@@ -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();
 
index f843df31e3e077bc2a468176a429992db6d06be3..c6184e306c3359023c5e173ea5d6bf92b9ff58ac 100644 (file)
@@ -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>