diff options
author | Andrew Dolgov <[email protected]> | 2018-08-12 19:27:04 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-08-12 19:27:04 +0300 |
commit | eb43d9f4a8a8609b7f30ef4e2add425b9c91fe00 (patch) | |
tree | 2dd62e5b77032aa71550b7b428d725f7d5baac61 | |
parent | 7418323f530f8364cb5f67e0528f75bad3491743 (diff) |
fix previous to not crash if document first child is not a DOMElement or whatever
-rw-r--r-- | classes/feeditem/atom.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index ee5591757..8c3e0f8a7 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -205,7 +205,11 @@ class FeedItem_Atom extends FeedItem_Common { return $lang; } else { // Fall back to the language declared on the feed, if any. - return $this->doc->firstChild->getAttributeNS(self::NS_XML, "lang"); + foreach ($this->doc->childNodes as $child) { + if (method_exists($child, "getAttributeNS")) { + return $child->getAttributeNS(self::NS_XML, "lang"); + } + } } } } |