Performing & allowing host-meta discovery by http url (in addition to webfinger acct)

This commit is contained in:
James Walker
2010-03-13 18:35:00 -05:00
parent 99ca84e68e
commit 85cf90cf0f
2 changed files with 15 additions and 11 deletions

View File

@@ -157,12 +157,13 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD
{
public function discover($uri)
{
if (!Discovery::isWebfinger($uri)) {
return false;
if (Discovery::isWebfinger($uri)) {
// We have a webfinger acct: - start with host-meta
list($name, $domain) = explode('@', $uri);
} else {
$domain = parse_url($uri, PHP_URL_HOST);
}
// We have a webfinger acct: - start with host-meta
list($name, $domain) = explode('@', $uri);
$url = 'http://'. $domain .'/.well-known/host-meta';
$xrd = Discovery::fetchXrd($url);