Fix feed discovery: html:link@rel can contain multiple values; saw rel="updates alternate" in the wild at http://tantek.com/ which broke old discovery code.
This commit is contained in:
parent
c9232d8f26
commit
dfac4bfd09
@ -211,11 +211,11 @@ class FeedDiscovery
|
|||||||
$type = $node->attributes->getNamedItem('type');
|
$type = $node->attributes->getNamedItem('type');
|
||||||
$href = $node->attributes->getNamedItem('href');
|
$href = $node->attributes->getNamedItem('href');
|
||||||
if ($rel && $type && $href) {
|
if ($rel && $type && $href) {
|
||||||
$rel = trim($rel->value);
|
$rel = array_filter(explode(" ", $rel->value));
|
||||||
$type = trim($type->value);
|
$type = trim($type->value);
|
||||||
$href = trim($href->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...
|
// Save the first feed found of each type...
|
||||||
$feeds[$type] = $this->resolveURI($href, $base);
|
$feeds[$type] = $this->resolveURI($href, $base);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user