diff options
author | Andrew Dolgov <[email protected]> | 2013-05-16 09:19:56 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-05-16 09:19:56 +0400 |
commit | 2700440178fa78f2908a6ae4114cf313cf1a0614 (patch) | |
tree | a7eecfb7f0fa7cd3f63361c375f64e07ced3eb4f | |
parent | c594eca0de78f46bd5f18194c058d94487d1a9e2 (diff) |
better support for atom content type xhtml
-rw-r--r-- | classes/feeditem/atom.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index 1cfa4bcc5..73a586d5b 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -41,9 +41,8 @@ class FeedItem_Atom extends FeedItem_Common { $content = $this->elem->getElementsByTagName("content")->item(0); if ($content) { - if ($content->hasChildNodes()) { - - if ($content->getElementsByTagName("*")->length > 1) { + if ($content->hasAttribute('type')) { + if ($content->getAttribute('type') == 'xhtml') { return $this->doc->saveXML($content->firstChild->nextSibling); } } @@ -53,11 +52,18 @@ class FeedItem_Atom extends FeedItem_Common { } function get_description() { - $summary = $this->elem->getElementsByTagName("summary")->item(0); + $content = $this->elem->getElementsByTagName("summary")->item(0); + + if ($content) { + if ($content->hasAttribute('type')) { + if ($content->getAttribute('type') == 'xhtml') { + return $this->doc->saveXML($content->firstChild->nextSibling); + } + } - if ($summary) { - return $summary->nodeValue; + return $content->nodeValue; } + } function get_categories() { |