check count before foreach
This commit is contained in:
parent
0db637bf00
commit
184230e068
1 changed files with 3 additions and 2 deletions
|
@ -918,8 +918,9 @@ function conv_sort($arr,$order) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach($parents as $x) {
|
foreach($parents as $x) {
|
||||||
$ret[] = $x;
|
$ret[] = $x;
|
||||||
foreach($x['children'] as $y)
|
if(count($x['children']))
|
||||||
$ret[] = $y;
|
foreach($x['children'] as $y)
|
||||||
|
$ret[] = $y;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
Loading…
Reference in a new issue