summaryrefslogtreecommitdiff
path: root/classes/feeditem
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-06-20 21:16:06 +0400
committerAndrew Dolgov <[email protected]>2013-06-20 21:16:06 +0400
commitbc3c887f4f1c0fd1b9a0a2bd290980683988106e (patch)
treed1571a29494b6aacba30d530ce8a351b4cfe667c /classes/feeditem
parentdda1d43508c5831090fe183aaa375a9645b982ba (diff)
better root element detection for atom content type xhtml (closes #720)
Diffstat (limited to 'classes/feeditem')
-rw-r--r--classes/feeditem/atom.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index 9680748f9..fa6b3a34c 100644
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -58,7 +58,13 @@ class FeedItem_Atom extends FeedItem_Common {
if ($content) {
if ($content->hasAttribute('type')) {
if ($content->getAttribute('type') == 'xhtml') {
- return $this->doc->saveXML($content->firstChild->nextSibling);
+ for ($i = 0; $i < $content->childNodes->length; $i++) {
+ $child = $content->childNodes->item($i);
+
+ if ($child->hasChildNodes()) {
+ return $this->doc->saveXML($child);
+ }
+ }
}
}
@@ -72,7 +78,13 @@ class FeedItem_Atom extends FeedItem_Common {
if ($content) {
if ($content->hasAttribute('type')) {
if ($content->getAttribute('type') == 'xhtml') {
- return $this->doc->saveXML($content->firstChild->nextSibling);
+ for ($i = 0; $i < $content->childNodes->length; $i++) {
+ $child = $content->childNodes->item($i);
+
+ if ($child->hasChildNodes()) {
+ return $this->doc->saveXML($child);
+ }
+ }
}
}