Commit 760af0b6 authored by Franco Fichtner's avatar Franco Fichtner

mvc: as previously seen PHP has trouble iterating over empty nodes

It feels like 2105 and is_array() -> isset() all over again...
parent a3cc4aab
......@@ -105,9 +105,12 @@ class MenuSystem
}
// add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement.
$ifarr = array();
foreach (Config::getInstance()->object()->interfaces->children() as $key => $node) {
if (empty($node->virtual)) {
$ifarr[$key] = !empty($node->descr) ? (string)$node->descr : strtoupper($key);
$config = Config::getInstance()->object();
if ($config->interfaces->count() > 0) {
foreach ($config->interfaces->children() as $key => $node) {
if (empty($node->virtual)) {
$ifarr[$key] = !empty($node->descr) ? (string)$node->descr : strtoupper($key);
}
}
}
natcasesort($ifarr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment