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