// TRANS: Error text.
$this->error = _m("Sorry, we could not reach that feed. Please try that OStatus address again later.");
common_debug('Not a recognized feed type.', __FILE__);
+ } catch (FeedSubNoHubException $e) {
+ // TRANS: Error text.
+ $this->error = _m("Sorry, that feed is not Pubsubhubub enabled.");
+ common_debug('No hub found.', __FILE__);
} catch (Exception $e) {
// Any new ones we forgot about
// TRANS: Error message in OStatus plugin. Do not translate the domain names example.com
}
}
- // 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