summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--includes/menu.inc8
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index ee31c11..4b7aaf2 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,8 @@
Drupal 5.20-dev xxxx-xx-xx
-----------------------
+- The 'access' element for hook_menu() now interprets Drupal 6 style values,
+ like array('access content').
Drupal 5.19, 2009-07-01
-----------------------
diff --git a/includes/menu.inc b/includes/menu.inc
index 8660343..d46718a 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1055,6 +1055,10 @@ function _menu_build() {
$temp_mid = -1;
foreach ($menu_item_list as $item) {
+ // Protect against D6 style access
+ if (isset($item['access']) && is_array($item['access']) && count($item['access']) == 1 && isset($item['access'][0]) && is_string($item['access'][0])) {
+ $item['access'] = FALSE;
+ }
if (!isset($item['path'])) {
$item['path'] = '';
}
@@ -1225,6 +1229,10 @@ function _menu_append_contextual_items() {
$new_items = array();
foreach ($menu_item_list as $item) {
+ // Protect against D6 style access
+ if (isset($item['access']) && is_array($item['access']) && count($item['access']) == 1 && isset($item['access'][0]) && is_string($item['access'][0])) {
+ $item['access'] = FALSE;
+ }
if (isset($item['callback'])) {
$_menu['callbacks'][$item['path']] = array('callback' => $item['callback']);
if (isset($item['callback arguments'])) {