summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-09 21:44:42 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-09 21:44:42 +0000
commitc56896224a12702e21bcf281c5a794610f8bd420 (patch)
tree76e46f7dc1fde2291b2a8758a6d9a42eac480b8f /includes
parent47adadda2a11aab2d0490180a353d3a2c38a7c6c (diff)
downloadbrdo-c56896224a12702e21bcf281c5a794610f8bd420.tar.gz
brdo-c56896224a12702e21bcf281c5a794610f8bd420.tar.bz2
#57810, avoid running in infinite loop, patch by chx
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc4
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) {