From e55a5ec601eb1e5df52d9299327ad63a621889ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 21 Apr 2015 13:40:22 +0300 Subject: [PATCH] atom: consider link rel=alternate in feed element for site urls --- classes/feedparser.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/feedparser.php b/classes/feedparser.php index 30af6f62e..9247bf450 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -141,9 +141,14 @@ class FeedParser { $link = $xpath->query("//atom:feed/atom:link[not(@rel)]")->item(0); + if (!$link) + $link = $xpath->query("//atom:feed/atom:link[@rel='alternate']")->item(0); + if (!$link) $link = $xpath->query("//atom03:feed/atom03:link[not(@rel)]")->item(0); + if (!$link) + $link = $xpath->query("//atom03:feed/atom03:link[@rel='alternate']")->item(0); if ($link && $link->hasAttributes()) { $this->link = $link->getAttribute("href");