]> git.wh0rd.org Git - tt-rss.git/commitdiff
atom: consider link rel=alternate in feed element for site urls
authorAndrew Dolgov <noreply@fakecake.org>
Tue, 21 Apr 2015 10:40:22 +0000 (13:40 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Tue, 21 Apr 2015 10:40:22 +0000 (13:40 +0300)
classes/feedparser.php

index 30af6f62ebec7688f3478b6673c0b123db929f23..9247bf45062f17b25b94438ee674b7fb91fad324 100644 (file)
@@ -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");