fix previous to not crash if document first child is not a DOMElement or whatever
This commit is contained in:
parent
7418323f53
commit
eb43d9f4a8
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue