summaryrefslogtreecommitdiff
path: root/includes/menu.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:52:09 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:52:09 -0700
commit7ee124b9ccb626cfa93dbcaf2b158b54b9305bec (patch)
treedc4ad7163bd55d0080515e01aeabec233108a4b3 /includes/menu.inc
parent53ff0485deef33ba83fe9a4c841c2f2f91160f46 (diff)
downloadbrdo-7ee124b9ccb626cfa93dbcaf2b158b54b9305bec.tar.gz
brdo-7ee124b9ccb626cfa93dbcaf2b158b54b9305bec.tar.bz2
Issue #261148 follow-up by mikeytown2, chx: Fixed menu_masks() variable is empty (race condition).
Diffstat (limited to 'includes/menu.inc')
-rw-r--r--includes/menu.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index eec342f69..b25a374ac 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -321,7 +321,14 @@ function menu_get_ancestors($parts) {
$ancestors = array();
$length = $number_parts - 1;
$end = (1 << $number_parts) - 1;
- $masks = variable_get('menu_masks', array());
+ $masks = variable_get('menu_masks');
+ // If the optimized menu_masks array is not available use brute force to get
+ // the correct $ancestors and $placeholders returned. Do not use this as the
+ // default value of the menu_masks variable to avoid building such a big
+ // array.
+ if (!$masks) {
+ $masks = range(511, 1);
+ }
// Only examine patterns that actually exist as router items (the masks).
foreach ($masks as $i) {
if ($i > $end) {