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