diff options
Diffstat (limited to 'classes/feeditem/rss.php')
-rw-r--r-- | classes/feeditem/rss.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index 34dfee1f1..e09a1fbba 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -19,10 +19,16 @@ class FeedItem_RSS extends FeedItem_Common { } function get_link() { - $link = $this->xpath->query("atom:link", $this->elem)->item(0); + $links = $this->xpath->query("atom:link", $this->elem); - if ($link) { - return $link->getAttribute("href"); + foreach ($links as $link) { + if ($link && $link->hasAttribute("href") && + (!$link->hasAttribute("rel") + || $link->getAttribute("rel") == "alternate" + || $link->getAttribute("rel") == "standout")) { + + return $link->getAttribute("href"); + } } $link = $this->elem->getElementsByTagName("guid")->item(0); |