If we are given a direct URL to a feed, use that

This commit is contained in:
Stephen Paul Weber
2015-10-28 00:54:20 +00:00
parent 0ba53edd96
commit e58c529c53
2 changed files with 16 additions and 5 deletions

View File

@@ -810,14 +810,21 @@ class Ostatus_profile extends Managed_DataObject
}
}
// Try to get some hCard data
if (in_array(
preg_replace('/\s*;.*$/', '', $response->getHeader('Content-Type')),
array('application/rss+xml', 'application/atom+xml', 'application/xml', 'text/xml'))
) {
$hints['feedurl'] = $response->getUrl();
} else {
// Try to get some hCard data
$body = $response->getBody();
$body = $response->getBody();
$hcardHints = DiscoveryHints::hcardHints($body, $finalUrl);
$hcardHints = DiscoveryHints::hcardHints($body, $finalUrl);
if (!empty($hcardHints)) {
$hints = array_merge($hints, $hcardHints);
if (!empty($hcardHints)) {
$hints = array_merge($hints, $hcardHints);
}
}
// Check if they've got an LRDD header