=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-09-10 12:21:30 +0000
+++ includes/menu.inc	2007-09-22 11:26:25 +0000
@@ -332,18 +332,30 @@ function menu_execute_active_handler($pa
  */
 function _menu_load_objects($item, &$map) {
   if ($item['load_functions']) {
-    $load_functions = unserialize($item['load_functions']);
-    $path_map = $map;
-    foreach ($load_functions as $index => $function) {
-      if ($function) {
-        $return = $function(isset($path_map[$index]) ? $path_map[$index] : '');
-        // If callback returned an error or there is no callback, trigger 404.
-        if ($return === FALSE) {
-          $item['access'] = FALSE;
-          $map = FALSE;
-          return FALSE;
+    // serialized field
+    if ($item['load_functions'][1] == ':') {
+      $load_functions = unserialize($item['load_functions']);
+      $path_map = $map;
+      foreach ($load_functions as $index => $function) {
+        if ($function) {
+          $return = $function(isset($path_map[$index]) ? $path_map[$index] : '');
+          // If callback returned an error or there is no callback, trigger 404.
+          if ($return === FALSE) {
+            $item['access'] = FALSE;
+            $map = FALSE;
+            return FALSE;
+          }
+          $map[$index] = $return;
         }
-        $map[$index] = $return;
+      }
+    }
+    else {
+      $function = $item['load_functions'];
+      $function($map);
+      // If callback returned an error, trigger 404.
+      if ($map === FALSE) {
+        $item['access'] = FALSE;
+        return FALSE;
       }
     }
   }
@@ -1273,7 +1285,7 @@ function menu_set_active_trail($new_trai
     if ($item['tab_parent']) {
       // The title of a local task is used for the tab, never the page title.
       // Thus, replace it with the item corresponding to the root path to get
-      // the relevant href and title.  For example, the menu item corresponding 
+      // the relevant href and title.  For example, the menu item corresponding
       // to 'admin' is used when on the 'By module' tab at 'admin/by-module'.
       $parts = explode('/', $item['tab_root']);
       $args = arg();
@@ -1869,6 +1881,10 @@ function _menu_router_build($callbacks) 
             $load_functions[$k] = $matches[1] .'_load';
             $match = TRUE;
           }
+          if (function_exists($matches[1] .'_menu_map')) {
+            $map_function = $matches[1] .'_menu_map';
+            $match = TRUE;
+          }
         }
       }
       if ($match) {
@@ -1887,6 +1903,10 @@ function _menu_router_build($callbacks) 
     }
     $masks[$fit] = 1;
     $item['load_functions'] = empty($load_functions) ? '' : serialize($load_functions);
+    if (isset($map_function)) {
+      $item['load_functions'] = $map_function;
+      unset($map_function);
+    }
     $item['to_arg_functions'] = empty($to_arg_functions) ? '' : serialize($to_arg_functions);
     $item += array(
       'title' => '',

=== modified file 'modules/user/user.module'
--- modules/user/user.module	2007-09-19 18:00:52 +0000
+++ modules/user/user.module	2007-09-22 11:51:38 +0000
@@ -1050,7 +1050,7 @@ function user_menu() {
     foreach ($categories as $key => $category) {
       // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
       if ($category['name'] != 'account') {
-        $items['user/%user/edit/'. $category['name']] = array(
+        $items['user/%user_category/edit/'. $category['name']] = array(
           'title callback' => 'check_plain',
           'title arguments' => array($category['title']),
           'page callback' => 'user_edit',
@@ -1058,6 +1058,7 @@ function user_menu() {
           'type' => MENU_LOCAL_TASK,
           'weight' => $category['weight'],
           'file' => 'user.pages.inc',
+          'tab_parent' => 'user/%/edit',
         );
       }
     }
@@ -1081,6 +1082,34 @@ function user_current_to_arg($arg) {
   return $GLOBALS['user']->uid;
 }
 
+function user_category_menu_map(&$map) {
+  static $categories;
+  if (!isset($categories)) {
+    $empty_account = new stdClass();
+    foreach (_user_categories($empty_account) as $category) {
+      $categories[$category['name']] = TRUE;
+    }
+  }
+  if ($account = user_load($map[1])) {
+    $category = implode('/', array_slice($map, 3));
+    $map = array($map[0], $account, $map[2]);
+    // There is no category on user/%/edit and it's still a valid path.
+    if ($category) {
+      // Is this a valid category?
+      if (isset($categories[$category])) {
+        $map[] = $category;
+      }
+      else {
+        $map = FALSE;
+      }
+    }
+  }
+  else {
+    // If there is no user, then the path is invalid.
+    $map = FALSE;
+  }
+}
+
 /**
  * Accepts an user object, $account, or a DA name and returns an associative
  * array of modules and DA names. Called at external login.

=== modified file 'themes/garland/page.tpl.php'
--- themes/garland/page.tpl.php	2007-09-06 21:17:07 +0000
+++ themes/garland/page.tpl.php	2007-09-22 09:55:02 +0000
@@ -32,7 +32,9 @@
             $site_fields[] = check_plain($site_slogan);
           }
           $site_title = implode(' ', $site_fields);
-          $site_fields[0] = '<span>'. $site_fields[0] .'</span>';
+          if ($site_fields) {
+            $site_fields[0] = '<span>'. $site_fields[0] .'</span>';
+          }
           $site_html = implode(' ', $site_fields);
 
           if ($logo || $site_title) {

