#57810, avoid running in infinite loop, patch by chx
parent
47adadda2a
commit
c56896224a
|
|
@ -596,8 +596,10 @@ function menu_rebuild() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$old_count = -1;
|
||||||
// Save the new items updating the pids in each iteration
|
// Save the new items updating the pids in each iteration
|
||||||
while (count($new_items)) {
|
while (($c = count($new_items)) && ($c != $old_count)) {
|
||||||
|
$old_count = count($new_items);
|
||||||
foreach($new_items as $mid => $item) {
|
foreach($new_items as $mid => $item) {
|
||||||
// If the item has a valid parent, save it
|
// If the item has a valid parent, save it
|
||||||
if ($item['pid'] >= 0) {
|
if ($item['pid'] >= 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue