1
1
Fork 0

check count before foreach

This commit is contained in:
friendica 2012-01-02 22:58:09 -08:00
parent 0db637bf00
commit 184230e068

View file

@ -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;