[support] Limiting path arguments to hook_menu

DTH david at hartster.org
Thu Jul 12 07:34:09 UTC 2012


I have (in D7)

function foo_menu() {
  $items = array();
  $items['foo'] = array(
    'title' => 'Foo',
    'page arguments' => array("foo"),
    'page callback' => 'super_page',
    'access arguments' => array('access content'),
    'file' => 'pages/super_page.inc',
    'type' => MENU_CALLBACK,
  );
return $items
}

At the moment, /foo works as a path. However, so does /foo/bar etc,
which calls the super_page callback. In reality I'd like this to 404.
Is there something obvious I'm missing or do I need to count the
number of arguments passed to things like super_page and return
drupal_not_found()?


More information about the support mailing list