mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 11:59:56 +00:00
DAT-2824 Fix warnings when node has no child nodes
This commit is contained in:
parent
f8bcf4f2a8
commit
025bd86a12
|
@ -28,8 +28,12 @@ class SimpleXmlUtil {
|
|||
public function getInnerXML( $node ) {
|
||||
$innerXML = '';
|
||||
if ( $node instanceof \SimpleXMLElement ) {
|
||||
foreach ( dom_import_simplexml( $node )->childNodes as $child ) {
|
||||
$innerXML .= $child->ownerDocument->saveXML( $child );
|
||||
$domDocument = dom_import_simplexml( $node );
|
||||
|
||||
if ( $domDocument->childNodes->length ) {
|
||||
foreach ( $domDocument->childNodes as $child ) {
|
||||
$innerXML .= $child->ownerDocument->saveXML( $child );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $innerXML;
|
||||
|
|
Loading…
Reference in a new issue