logger('webfinger_dfrn: ' . $webbie . ':' . print_r($links,true), LOGGER_DATA);
if(count($links)) {
foreach($links as $link) {
- if($link['@attributes']['rel'] === NAMESPACE_DFRN)
+ if(empty($profile_link) && $link['@attributes']['rel'] === NAMESPACE_DFRN) {
$profile_link = $link['@attributes']['href'];
- if($link['@attributes']['rel'] === NAMESPACE_OSTATUSSUB)
+ } elseif(empty($profile_link) && $link['@attributes']['rel'] === NAMESPACE_OSTATUSSUB) {
$profile_link = 'stat:' . $link['@attributes']['template'];
- if($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard')
+ } elseif(empty($hcard) && $link['@attributes']['rel'] === 'http://microformats.org/profile/hcard') {
$hcard = $link['@attributes']['href'];
+ }
}
}
return $profile_link;
$data = probe_url($url);
$network = $data["network"];
+ logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - BEFORE!', LOGGER_DEBUG);
+
// Canonicalise email-style profile locator
$url = webfinger_dfrn($url,$hcard);
+ logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - AFTER!', LOGGER_DEBUG);
+
if (substr($url,0,5) === 'stat:') {
// Every time we detect the remote subscription we define this as OStatus.