diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index afb5368968..349afaba50 100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -4,7 +4,14 @@ if($_SERVER['SCRIPT_NAME'] == '/.well-known/webfinger.php') { } else { header('Please-first: activate'); } -header("Content-Type: application/xml+xrd"); +// header("Content-Type: application/xml+xrd"); + +// calculate the documentroot +// modified version of the one in lib/base.php that takes the .well-known symlink into account +$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); +$SERVERROOT=str_replace("\\",'/',dirname(dirname(dirname(dirname(__FILE__))))); +$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); +$WEBROOT=substr($SUBURI,0,-34); if($_GET['q']) { $bits = explode('@', $_GET['q']); @@ -20,5 +27,5 @@ echo "<"; ?xml version="1.0" encoding="UTF-8"?> - +