diff options
Diffstat (limited to 'classes/feeditem/rss.php')
-rw-r--r-- | classes/feeditem/rss.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index 2f363b4f6..e09a1fbba 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -19,6 +19,24 @@ class FeedItem_RSS extends FeedItem_Common { } function get_link() { + $links = $this->xpath->query("atom:link", $this->elem); + + 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); + + if ($link && $link->hasAttributes() && $link->getAttribute("isPermaLink") == "true") { + return $link->nodeValue; + } + $link = $this->elem->getElementsByTagName("link")->item(0); if ($link) { |