#57810, avoid running in infinite loop, patch by chx

4.7.x
Gerhard Killesreiter 2006-04-09 21:44:42 +00:00
parent 47adadda2a
commit c56896224a
1 changed files with 3 additions and 1 deletions

View File

@ -596,8 +596,10 @@ function menu_rebuild() {
}
}
$old_count = -1;
// 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) {
// If the item has a valid parent, save it
if ($item['pid'] >= 0) {