Skip to content
Snippets Groups Projects
Commit 27004401 authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

better support for atom content type xhtml

parent c594eca0
No related branches found
No related tags found
No related merge requests found
...@@ -41,9 +41,8 @@ class FeedItem_Atom extends FeedItem_Common { ...@@ -41,9 +41,8 @@ class FeedItem_Atom extends FeedItem_Common {
$content = $this->elem->getElementsByTagName("content")->item(0); $content = $this->elem->getElementsByTagName("content")->item(0);
if ($content) { if ($content) {
if ($content->hasChildNodes()) { if ($content->hasAttribute('type')) {
if ($content->getAttribute('type') == 'xhtml') {
if ($content->getElementsByTagName("*")->length > 1) {
return $this->doc->saveXML($content->firstChild->nextSibling); return $this->doc->saveXML($content->firstChild->nextSibling);
} }
} }
...@@ -53,11 +52,18 @@ class FeedItem_Atom extends FeedItem_Common { ...@@ -53,11 +52,18 @@ class FeedItem_Atom extends FeedItem_Common {
} }
function get_description() { 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 $content->nodeValue;
return $summary->nodeValue;
} }
} }
function get_categories() { function get_categories() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment