forked from GNUsocial/gnu-social
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
This commit is contained in:
@@ -154,12 +154,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);
|
||||
|
@@ -211,11 +211,11 @@ class FeedDiscovery
|
||||
$type = $node->attributes->getNamedItem('type');
|
||||
$href = $node->attributes->getNamedItem('href');
|
||||
if ($rel && $type && $href) {
|
||||
$rel = trim($rel->value);
|
||||
$rel = array_filter(explode(" ", $rel->value));
|
||||
$type = trim($type->value);
|
||||
$href = trim($href->value);
|
||||
|
||||
if (trim($rel) == 'alternate' && array_key_exists($type, $feeds) && empty($feeds[$type])) {
|
||||
if (in_array('alternate', $rel) && array_key_exists($type, $feeds) && empty($feeds[$type])) {
|
||||
// Save the first feed found of each type...
|
||||
$feeds[$type] = $this->resolveURI($href, $base);
|
||||
}
|
||||
|
@@ -46,10 +46,10 @@ class XrdAction extends Action
|
||||
if (empty($xrd->subject)) {
|
||||
$xrd->subject = Discovery::normalize($this->uri);
|
||||
}
|
||||
$xrd->alias[] = common_profile_url($nick);
|
||||
$xrd->alias[] = $this->user->uri;
|
||||
$xrd->links[] = array('rel' => Discovery::PROFILEPAGE,
|
||||
'type' => 'text/html',
|
||||
'href' => common_profile_url($nick));
|
||||
'href' => $this->user->uri);
|
||||
|
||||
$xrd->links[] = array('rel' => Discovery::UPDATESFROM,
|
||||
'href' => common_local_url('ApiTimelineUser',
|
||||
@@ -65,7 +65,7 @@ class XrdAction extends Action
|
||||
// XFN
|
||||
$xrd->links[] = array('rel' => 'http://gmpg.org/xfn/11',
|
||||
'type' => 'text/html',
|
||||
'href' => common_profile_url($nick));
|
||||
'href' => $this->user->uri);
|
||||
// FOAF
|
||||
$xrd->links[] = array('rel' => 'describedby',
|
||||
'type' => 'application/rdf+xml',
|
||||
|
Reference in New Issue
Block a user