kopia lustrzana https://github.com/friendica/friendica
Some fixes:
- Letting $profile_link and $hcard always been overwritten with newly found entries has caused DFRN network detectio to fail and "connect" is no longer working. This fix makes sure that these both variables are only set if they are still empty. - added more debug lines to see which URL was it before and after webfinger "detection" Signed-off-by: Roland Haeder <roland@mxchange.org>pull/3010/head
rodzic
7c04a0d232
commit
738e22d3eb
|
@ -393,12 +393,13 @@ function webfinger_dfrn($webbie,&$hcard) {
|
||||||
logger('webfinger_dfrn: ' . $webbie . ':' . print_r($links,true), LOGGER_DATA);
|
logger('webfinger_dfrn: ' . $webbie . ':' . print_r($links,true), LOGGER_DATA);
|
||||||
if(count($links)) {
|
if(count($links)) {
|
||||||
foreach($links as $link) {
|
foreach($links as $link) {
|
||||||
if($link['@attributes']['rel'] === NAMESPACE_DFRN)
|
if(empty($profile_link) && $link['@attributes']['rel'] === NAMESPACE_DFRN) {
|
||||||
$profile_link = $link['@attributes']['href'];
|
$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'];
|
$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'];
|
$hcard = $link['@attributes']['href'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $profile_link;
|
return $profile_link;
|
||||||
|
|
|
@ -441,9 +441,13 @@ function dfrn_request_post(&$a) {
|
||||||
$data = probe_url($url);
|
$data = probe_url($url);
|
||||||
$network = $data["network"];
|
$network = $data["network"];
|
||||||
|
|
||||||
|
logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - BEFORE!', LOGGER_DEBUG);
|
||||||
|
|
||||||
// Canonicalise email-style profile locator
|
// Canonicalise email-style profile locator
|
||||||
$url = webfinger_dfrn($url,$hcard);
|
$url = webfinger_dfrn($url,$hcard);
|
||||||
|
|
||||||
|
logger('dfrn_request: url=' . $url . ',network=' . $network . ',hcard=' . $hcard . ' - AFTER!', LOGGER_DEBUG);
|
||||||
|
|
||||||
if (substr($url,0,5) === 'stat:') {
|
if (substr($url,0,5) === 'stat:') {
|
||||||
|
|
||||||
// Every time we detect the remote subscription we define this as OStatus.
|
// Every time we detect the remote subscription we define this as OStatus.
|
||||||
|
|
Ładowanie…
Reference in New Issue