summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2013-04-09 18:57:44 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2013-04-09 18:57:44 +0200
commitd3ad2cfb8ccdcf404b04ea8c9042f21c8ffd5af4 (patch)
tree8f4f47b08df961a53269da021676d7eb6d685645 /src
parentc4ef276467ef0331e905c1aa70f9833a24d85d9c (diff)
downloadAntennaPod-d3ad2cfb8ccdcf404b04ea8c9042f21c8ffd5af4.zip
Recognize 'application/xml+xhtml' as valid link type for website
Diffstat (limited to 'src')
-rw-r--r--src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
index 25d0b7c35..1efaac359 100644
--- a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
+++ b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
@@ -45,6 +45,8 @@ public class NSAtom extends Namespace {
// type-values
private static final String LINK_TYPE_ATOM = "application/atom+xml";
private static final String LINK_TYPE_HTML = "text/html";
+ private static final String LINK_TYPE_XHTML = "application/xml+xhtml";
+
private static final String LINK_TYPE_RSS = "application/rss+xml";
/** Regexp to test whether an Element is a Text Element. */
@@ -90,7 +92,13 @@ public class NSAtom extends Namespace {
} else if (parent.getName().matches(isFeed)) {
if (rel == null || rel.equals(LINK_REL_ALTERNATE)) {
String type = attributes.getValue(LINK_TYPE);
- if (type != null && type.equals(LINK_TYPE_HTML)) {
+ /*
+ * Use as link if a) no type-attribute is given and
+ * feed-object has no link yet b) type of link is
+ * LINK_TYPE_HTML or LINK_TYPE_XHTML
+ */
+ if ((type == null && state.getFeed().getLink() == null)
+ || (type != null && (type.equals(LINK_TYPE_HTML) || type.equals(LINK_TYPE_XHTML)))) {
state.getFeed().setLink(href);
}
} else if (rel.equals(LINK_REL_PAYMENT)) {