summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-08-15 16:42:59 +0000
committerDries Buytaert <dries@buytaert.net>2004-08-15 16:42:59 +0000
commit9a26352b9cb63267d29f2e54a934dd9375954e95 (patch)
treefadf4558a42c8d96209112e433931683136efa93 /includes
parentba70b534b881665d5f73bf679d501800eae0673d (diff)
downloadbrdo-9a26352b9cb63267d29f2e54a934dd9375954e95.tar.gz
brdo-9a26352b9cb63267d29f2e54a934dd9375954e95.tar.bz2
- Patch #9864 by JonBob: better form validation in menu administration.
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index c8c8d6e8b..06bed087a 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -697,10 +697,10 @@ function _menu_build() {
// Now fetch items from the DB, reassigning menu IDs as needed.
if (module_exist('menu')) {
- $result = db_query('SELECT * FROM {menu}');
+ $result = db_query('SELECT * FROM {menu} ORDER BY mid ASC');
while ($item = db_fetch_object($result)) {
// Don't display non-custom menu items if no module declared them.
- if (array_key_exists($item->path, $_menu['path index'])) {
+ if (!($item->type & MENU_CREATED_BY_ADMIN) && array_key_exists($item->path, $_menu['path index'])) {
$old_mid = $_menu['path index'][$item->path];
$_menu['items'][$item->mid] = $_menu['items'][$old_mid];
unset($_menu['items'][$old_mid]);
@@ -718,7 +718,7 @@ function _menu_build() {
else if ($item->type & MENU_CREATED_BY_ADMIN) {
$_menu['items'][$item->mid] = array('pid' => $item->pid, 'path' => $item->path, 'title' => $item->title, 'description' => $item->description, 'access' => TRUE, 'weight' => $item->weight, 'type' => $item->type, 'callback' => '', 'callback arguments' => array());
- if (!empty($item->path)) {
+ if (!empty($item->path) && !array_key_exists($item->path, $_menu['path index'])) {
$_menu['path index'][$item->path] = $item->mid;
}
}