From 72c29b65d4494f6df83c558e3bd281ff440e20af Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <fox@madoka.volgo-balt.ru>
Date: Thu, 2 May 2013 10:40:59 +0400
Subject: [PATCH] atom: fix rel=alternate links

---
 classes/feeditem/atom.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index df1c31d99..b981dc319 100644
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -22,7 +22,8 @@ class FeedItem_Atom extends FeedItem_Common {
 		$links = $this->elem->getElementsByTagName("link");
 
 		foreach ($links as $link) {
-			if ($link && $link->hasAttribute("href") && !$link->hasAttribute("rel")) {
+			if ($link && $link->hasAttribute("href") && (!$link->hasAttribute("rel")
+					|| $link->getAttribute("rel") == "alternate")) {
 				return $link->getAttribute("href");
 			}
 		}
-- 
GitLab