mirror of
https://github.com/unraid/webgui.git
synced 2026-01-05 00:59:48 -06:00
Fix php warning
This commit is contained in:
@@ -632,7 +632,7 @@ function execCommand($command, $echo=true) {
|
||||
|
||||
function getXmlVal($xml, $element, $attr=null, $pos=0) {
|
||||
$xml = (is_file($xml)) ? simplexml_load_file($xml) : simplexml_load_string($xml);
|
||||
$element = $xml->xpath("//$element")[$pos];
|
||||
$element = $xml->xpath("//$element")[$pos] ?? null;
|
||||
return isset($element) ? (isset($element[$attr]) ? strval($element[$attr]) : strval($element)) : "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user