From: Andrew Dolgov Date: Tue, 21 Apr 2015 10:40:22 +0000 (+0300) Subject: atom: consider link rel=alternate in feed element for site urls X-Git-Tag: 16.3~329 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e55a5ec601eb1e5df52d9299327ad63a621889ba;p=tt-rss.git atom: consider link rel=alternate in feed element for site urls --- diff --git a/classes/feedparser.php b/classes/feedparser.php index 30af6f62..9247bf45 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");