diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-04-09 18:57:44 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-04-09 18:57:44 +0200 |
commit | d3ad2cfb8ccdcf404b04ea8c9042f21c8ffd5af4 (patch) | |
tree | 8f4f47b08df961a53269da021676d7eb6d685645 /src/de/danoeh/antennapod | |
parent | c4ef276467ef0331e905c1aa70f9833a24d85d9c (diff) | |
download | AntennaPod-d3ad2cfb8ccdcf404b04ea8c9042f21c8ffd5af4.zip |
Recognize 'application/xml+xhtml' as valid link type for website
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r-- | src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java | 10 |
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)) { |