webGui: improve reading docker template xml network settings

This commit is contained in:
Eric Schultz
2017-06-21 07:24:03 -05:00
parent 5cb295a088
commit 8537c50fe4

View File

@@ -291,11 +291,14 @@ function xmlToVar($xml) {
}
}
# some xml templates advertise as V2 but omit the new <Network> element
# check for and use the V1 <Networking> element when this occurs
if (empty($out['Network']) && isset($xml->Networking->Mode)) {
$out['Network'] = xml_decode($xml->Networking->Mode);
}
# V1 compatibility
if ($xml["version"] != "2") {
if (isset($xml->Networking->Mode)) {
$out['Network'] = xml_decode($xml->Networking->Mode);
}
if (isset($xml->Description)) {
$out['Overview'] = stripslashes(xml_decode($xml->Description));
}