diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-09 21:44:42 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-09 21:44:42 +0000 |
commit | c56896224a12702e21bcf281c5a794610f8bd420 (patch) | |
tree | 76e46f7dc1fde2291b2a8758a6d9a42eac480b8f /includes/menu.inc | |
parent | 47adadda2a11aab2d0490180a353d3a2c38a7c6c (diff) | |
download | brdo-c56896224a12702e21bcf281c5a794610f8bd420.tar.gz brdo-c56896224a12702e21bcf281c5a794610f8bd420.tar.bz2 |
#57810, avoid running in infinite loop, patch by chx
Diffstat (limited to 'includes/menu.inc')
-rw-r--r-- | includes/menu.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index b43042d01..f52fff486 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -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) { |