🚑 fix(config) Avoid using count on non-existing var

issue #6026
parent 476e80dc
......@@ -800,13 +800,6 @@ class config
/* Walk through array */
ksort($arr);
foreach ($arr as $name => $entries) {
/* If this department is the last in the current tree position
* remove it, to avoid generating output for it */
if (count($entries['SUB']) == 0) {
unset($entries['SUB']);
}
/* Fix name, if it contains a replace tag */
$name = preg_replace('/\\\\,/', ',', $name);
......@@ -825,7 +818,7 @@ class config
}
/* recursive add of subdepartments */
if (isset($entries['SUB'])) {
if (!empty($entries['SUB'])) {
$ret = array_merge($ret, $this->generateDepartmentArray($entries['SUB'], $depth, $max_size));
}
}
......
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