diff options
Diffstat (limited to 'apps/user_webfinger')
-rw-r--r--[-rwxr-xr-x] | apps/user_webfinger/appinfo/app.php | 0 | ||||
-rw-r--r-- | apps/user_webfinger/host-meta.php | 17 | ||||
-rw-r--r--[-rwxr-xr-x] | apps/user_webfinger/webfinger.php | 0 |
3 files changed, 1 insertions, 16 deletions
diff --git a/apps/user_webfinger/appinfo/app.php b/apps/user_webfinger/appinfo/app.php index a45efd96a46..a45efd96a46 100755..100644 --- a/apps/user_webfinger/appinfo/app.php +++ b/apps/user_webfinger/appinfo/app.php diff --git a/apps/user_webfinger/host-meta.php b/apps/user_webfinger/host-meta.php index c3d6f0ed2ca..32ffb512057 100644 --- a/apps/user_webfinger/host-meta.php +++ b/apps/user_webfinger/host-meta.php @@ -3,23 +3,8 @@ $hostMetaHeader = array( 'Access-Control-Allow-Origin' => '*', 'Content-Type' => 'application/xrd+json' ); -$ownCloudDir = dirname(dirname(dirname(__FILE__))); -$docRoot = $_SERVER['DOCUMENT_ROOT']; -try { - $webRoot = substr(realpath($ownCloudDir), strlen(realpath($docRoot))); -} catch(Exception $e) { - // some servers fail on realpath(), let's try it the unsecure way: - $webRoot = substr($ownCloudDir, strlen($docRoot)); -} $serverName = $_SERVER['SERVER_NAME']; -$lrddTmpl = 'http'; -if(isset($_SERVER['HTTPS'])) { - $lrddTmpl .= 's'; -} -$lrddTmpl .= '://' . $serverName . $webRoot . '/public.php?service=webfinger&q={uri}'; -$hostMetaPath = $docRoot . '/.well-known/host-meta'; -$hostMetaDir = $docRoot . '/.well-known'; -$hostMetaContents = "{\"links\":[{\"rel\":\"lrdd\",\"template\":\"http://mich.oc/public.php?service=webfinger&q={uri}\"}]}"; +$hostMetaContents = '{"links":[{"rel":"lrdd","template":"http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$serverName.'/public.php?service=webfinger&q={uri}"}]}'; foreach($hostMetaHeader as $header => $value) { header($header . ": " . $value); } diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index e75c546c2cb..e75c546c2cb 100755..100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php |