Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.416
diff -u -p -r1.416 bootstrap.inc
--- includes/bootstrap.inc	22 Aug 2010 14:11:47 -0000	1.416
+++ includes/bootstrap.inc	24 Aug 2010 13:46:31 -0000
@@ -1741,7 +1741,7 @@ function drupal_get_title() {
 
   // During a bootstrap, menu.inc is not included and thus we cannot provide a title.
   if (!isset($title) && function_exists('menu_get_active_title')) {
-    $title = check_plain(menu_get_active_title());
+    $title = menu_get_active_title();
   }
 
   return $title;
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.407
diff -u -p -r1.407 menu.inc
--- includes/menu.inc	23 Aug 2010 23:38:06 -0000	1.407
+++ includes/menu.inc	24 Aug 2010 13:46:31 -0000
@@ -662,15 +662,15 @@ function _menu_item_localize(&$item, $ma
       else {
         $item['title'] = call_user_func_array($callback, menu_unserialize($item['title_arguments'], $map));
       }
-      // Avoid calling check_plain again on l() function.
-      if ($callback == 'check_plain') {
-        $item['localized_options']['html'] = TRUE;
-      }
     }
   }
   elseif ($link_translate) {
     $item['title'] = $item['link_title'];
   }
+  // Avoid calling check_plain again on l() function.
+  if ($callback == 'check_plain' || $item['title_output'] == PASS_THROUGH) {
+    $item['localized_options']['html'] = TRUE;
+  }
 
   // Translate description, see the motivation above.
   if (!empty($item['description'])) {
@@ -1244,6 +1244,7 @@ function _menu_build_tree($menu_name, ar
       'title',
       'title_callback',
       'title_arguments',
+      'title_output',
       'theme_callback',
       'theme_arguments',
       'type',
@@ -2132,7 +2133,7 @@ function menu_set_active_trail($new_trai
   }
   elseif (!isset($trail)) {
     $trail = array();
-    $trail[] = array('title' => t('Home'), 'href' => '<front>', 'localized_options' => array(), 'type' => 0);
+    $trail[] = array('title' => t('Home'), 'href' => '<front>', 'localized_options' => array(), 'type' => 0, 'title_output' => CHECK_PLAIN);
     $item = menu_get_item();
 
     // Check whether the current item is a local task (displayed as a tab).
@@ -2247,7 +2248,7 @@ function menu_get_active_title() {
 
   foreach (array_reverse($active_trail) as $item) {
     if (!(bool) ($item['type'] & MENU_IS_LOCAL_TASK)) {
-      return $item['title'];
+      return $item['title_output'] == PASS_THROUGH ? $item['title'] : check_plain($item['title']);
     }
   }
 }
@@ -3285,6 +3286,7 @@ function _menu_router_build($callbacks) 
       'block callback' => '',
       'title arguments' => array(),
       'title callback' => 't',
+      'title output' => CHECK_PLAIN,
       'theme arguments' => array(),
       'theme callback' => '',
       'description' => '',
@@ -3339,6 +3341,7 @@ function _menu_router_save($menu, $masks
       'title',
       'title_callback',
       'title_arguments',
+      'title_output',
       'theme_callback',
       'theme_arguments',
       'type',
@@ -3370,6 +3373,7 @@ function _menu_router_save($menu, $masks
       'title' => $item['title'],
       'title_callback' => $item['title callback'],
       'title_arguments' => ($item['title arguments'] ? serialize($item['title arguments']) : ''),
+      'title_output' => $item['title output'],
       'theme_callback' => $item['theme callback'],
       'theme_arguments' => serialize($item['theme arguments']),
       'type' => $item['type'],
Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.442
diff -u -p -r1.442 aggregator.module
--- modules/aggregator/aggregator.module	4 Aug 2010 03:54:54 -0000	1.442
+++ modules/aggregator/aggregator.module	24 Aug 2010 13:55:34 -0000
@@ -224,6 +224,8 @@ function aggregator_menu() {
     'file' => 'aggregator.admin.inc',
   );
   $items['aggregator/sources/%aggregator_feed'] = array(
+    'title callback' => 'aggregator_menu_title_source',
+    'title arguments' => array(2),
     'page callback' => 'aggregator_page_source',
     'page arguments' => array(2),
     'access arguments' => array('access news feeds'),
@@ -273,6 +275,13 @@ function aggregator_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function aggregator_menu_title_source($feed) {
+  return $feed->title;
+}
+
+/**
  * Menu callback.
  *
  * @return
Index: modules/aggregator/aggregator.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v
retrieving revision 1.43
diff -u -p -r1.43 aggregator.pages.inc
--- modules/aggregator/aggregator.pages.inc	3 Aug 2010 02:02:01 -0000	1.43
+++ modules/aggregator/aggregator.pages.inc	24 Aug 2010 13:55:38 -0000
@@ -30,7 +30,6 @@ function aggregator_page_last() {
  *   The rendered list of items for a feed.
  */
 function aggregator_page_source($feed) {
-  drupal_set_title($feed->title);
   $feed_source = theme('aggregator_feed_source', array('feed' => $feed));
 
   // It is safe to include the fid in the query because it's loaded from the
Index: modules/blog/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.359
diff -u -p -r1.359 blog.module
--- modules/blog/blog.module	17 Aug 2010 16:20:07 -0000	1.359
+++ modules/blog/blog.module	24 Aug 2010 14:00:53 -0000
@@ -107,6 +107,9 @@ function blog_menu() {
   );
   $items['blog/%user_uid_optional'] = array(
     'title' => 'My blog',
+    'title callback' => 'blog_menu_title',
+    'title arguments' => array(1),
+    'title output' => PASS_THROUGH,
     'page callback' => 'blog_page_user',
     'page arguments' => array(1),
     'access callback' => 'blog_page_user_access',
@@ -134,6 +137,13 @@ function blog_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function blog_menu_title($account) {
+  return t("@name's blog", array('@name' => format_username($account)));
+}
+
+/**
  * Implements hook_menu_local_tasks_alter().
  */
 function blog_menu_local_tasks_alter(&$data, $router_item, $root_path) {
Index: modules/blog/blog.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.pages.inc,v
retrieving revision 1.28
diff -u -p -r1.28 blog.pages.inc
--- modules/blog/blog.pages.inc	3 Aug 2010 02:02:02 -0000	1.28
+++ modules/blog/blog.pages.inc	24 Aug 2010 14:00:23 -0000
@@ -12,8 +12,6 @@
 function blog_page_user($account) {
   global $user;
 
-  drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH);
-
   $build = array();
 
   $query = db_select('node', 'n')->extend('PagerDefault');
@@ -45,7 +43,9 @@ function blog_page_user($account) {
       drupal_set_message(t('!author has not created any blog entries.', array('!author' => theme('username', array('account' => $account)))));
     }
   }
-  drupal_add_feed('blog/' . $account->uid . '/feed', t('RSS - !title', array('!title' => $title)));
+  drupal_add_feed('blog/' . $account->uid . '/feed', t('RSS - !title', array(
+    '!title' => t("@name's blog", array('@name' => format_username($account))),
+  )));
 
   return $build;
 }
Index: modules/book/book.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v
retrieving revision 1.36
diff -u -p -r1.36 book.admin.inc
--- modules/book/book.admin.inc	26 Jun 2010 21:32:20 -0000	1.36
+++ modules/book/book.admin.inc	24 Aug 2010 14:02:39 -0000
@@ -72,7 +72,6 @@ function book_admin_settings_validate($f
  * @ingroup forms.
  */
 function book_admin_edit($form, $form_state, $node) {
-  drupal_set_title($node->title);
   $form['#node'] = $node;
   _book_admin_table($node, $form);
   $form['save'] = array(
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.549
diff -u -p -r1.549 book.module
--- modules/book/book.module	17 Aug 2010 16:20:07 -0000	1.549
+++ modules/book/book.module	24 Aug 2010 14:04:15 -0000
@@ -147,6 +147,8 @@ function book_menu() {
   );
   $items['admin/content/book/%node'] = array(
     'title' => 'Re-order book pages and change titles',
+    'title callback' => 'node_page_title',
+    'title arguments' => array(3),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('book_admin_edit', 3),
     'access callback' => '_book_outline_access',
@@ -170,8 +172,10 @@ function book_menu() {
   );
   $items['node/%node/outline'] = array(
     'title' => 'Outline',
-    'page callback' => 'book_outline',
-    'page arguments' => array(1),
+    'title callback' => 'node_page_title',
+    'title arguments' => array(1),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('book_outline_form', 1),
     'access callback' => '_book_outline_access',
     'access arguments' => array(1),
     'theme callback' => '_node_custom_theme',
@@ -1279,7 +1283,7 @@ function book_menu_subtree_data($link) {
       $query->join('menu_router', 'm', 'm.path = ml.router_path');
       $query->join('book', 'b', 'ml.mlid = b.mlid');
       $query->fields('b');
-      $query->fields('m', array('load_functions', 'to_arg_functions', 'access_callback', 'access_arguments', 'page_callback', 'page_arguments', 'delivery_callback', 'title', 'title_callback', 'title_arguments', 'type'));
+      $query->fields('m', array('load_functions', 'to_arg_functions', 'access_callback', 'access_arguments', 'page_callback', 'page_arguments', 'delivery_callback', 'title', 'title_callback', 'title_arguments', 'title_output', 'type'));
       $query->fields('ml');
       $query->condition('menu_name', $link['menu_name']);
       for ($i = 1; $i <= MENU_MAX_DEPTH && $link["p$i"]; ++$i) {
Index: modules/book/book.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.pages.inc,v
retrieving revision 1.27
diff -u -p -r1.27 book.pages.inc
--- modules/book/book.pages.inc	7 Jul 2010 01:07:33 -0000	1.27
+++ modules/book/book.pages.inc	24 Aug 2010 14:04:25 -0000
@@ -87,14 +87,6 @@ function book_export_html($nid) {
 }
 
 /**
- * Menu callback; show the outline form for a single node.
- */
-function book_outline($node) {
-  drupal_set_title($node->title);
-  return drupal_get_form('book_outline_form', $node);
-}
-
-/**
  * Build the form to handle all book outline operations via the outline tab.
  *
  * @see book_outline_form_submit()
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.892
diff -u -p -r1.892 comment.module
--- modules/comment/comment.module	23 Aug 2010 14:53:50 -0000	1.892
+++ modules/comment/comment.module	24 Aug 2010 14:08:07 -0000
@@ -231,6 +231,7 @@ function comment_menu() {
   $items['admin/content/comment/approval'] = array(
     'title' => 'Unapproved comments',
     'title callback' => 'comment_count_unpublished',
+    'title output' => PASS_THROUGH,
     'page arguments' => array('approval'),
     'access arguments' => array('administer comments'),
     'type' => MENU_LOCAL_TASK,
@@ -251,8 +252,11 @@ function comment_menu() {
   // so we don't end up loading it twice (in the page and access callback).
   $items['comment/%comment/edit'] = array(
     'title' => 'Edit',
-    'page callback' => 'comment_edit_page',
-    'page arguments' => array(1),
+    'title callback' => 'comment_menu_title_edit',
+    'title arguments' => array(1),
+    'title output' => PASS_THROUGH,
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('comment_form', 1),
     'access callback' => 'comment_access',
     'access arguments' => array('edit', 1),
     'type' => MENU_LOCAL_TASK,
@@ -290,6 +294,13 @@ function comment_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function comment_menu_title_edit($comment) {
+  return t('Edit comment %comment', array('%comment' => $comment->subject));
+}
+
+/**
  * Implements hook_init().
  */
 function comment_init() {
@@ -1751,14 +1762,6 @@ function comment_get_display_page($cid, 
 }
 
 /**
- * Page callback for comment editing.
- */
-function comment_edit_page($comment) {
-  drupal_set_title(t('Edit comment %comment', array('%comment' => $comment->subject)), PASS_THROUGH);
-  return drupal_get_form('comment_form', $comment);
-}
-
-/**
  * Generate the basic commenting form, for appending to a node or display on a separate page.
  *
  * @see comment_form_validate()
@@ -1987,7 +1990,7 @@ function comment_form_build_preview($for
 function comment_preview($comment) {
   global $user;
 
-  drupal_set_title(t('Preview comment'), PASS_THROUGH);
+  drupal_set_title(t('Preview comment'));
 
   $node = node_load($comment->nid);
 
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.147
diff -u -p -r1.147 contact.module
--- modules/contact/contact.module	13 Apr 2010 15:13:41 -0000	1.147
+++ modules/contact/contact.module	24 Aug 2010 14:09:53 -0000
@@ -98,6 +98,9 @@ function contact_menu() {
   );
   $items['user/%user/contact'] = array(
     'title' => 'Contact',
+    'title callback' => 'contact_menu_title_user',
+    'title arguments' => array(1),
+    'title output' => PASS_THROUGH,
     'page callback' => 'drupal_get_form',
     'page arguments' => array('contact_personal_form', 1),
     'type' => MENU_LOCAL_TASK,
@@ -110,6 +113,13 @@ function contact_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function contact_menu_title_user($account) {
+  return t('Contact @username', array('@username' => format_username($recipient)));
+}
+
+/**
  * Menu access callback for a user's personal contact form.
  *
  * @param $account
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.43
diff -u -p -r1.43 contact.pages.inc
--- modules/contact/contact.pages.inc	24 Apr 2010 14:49:13 -0000	1.43
+++ modules/contact/contact.pages.inc	24 Aug 2010 14:09:51 -0000
@@ -183,8 +183,6 @@ function contact_personal_form($form, &$
     drupal_exit();
   }
 
-  drupal_set_title(t('Contact @username', array('@username' => format_username($recipient))), PASS_THROUGH);
-
   if (!$user->uid) {
     $form['#attached']['library'][] = array('system', 'cookie');
     $form['#attributes']['class'][] = 'user-info-from-cookie';
Index: modules/image/image.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.admin.inc,v
retrieving revision 1.21
diff -u -p -r1.21 image.admin.inc
--- modules/image/image.admin.inc	30 Jul 2010 02:47:28 -0000	1.21
+++ modules/image/image.admin.inc	24 Aug 2010 14:16:28 -0000
@@ -36,9 +36,6 @@ function image_style_list() {
  * @see image_style_name_validate()
  */
 function image_style_form($form, &$form_state, $style) {
-  $title = t('Edit %name style', array('%name' => $style['name']));
-  drupal_set_title($title, PASS_THROUGH);
-
   // Adjust this form for styles that must be overridden to edit.
   $editable = (bool) ($style['storage'] & IMAGE_STORAGE_EDITABLE);
 
@@ -366,14 +363,6 @@ function image_style_revert_form_submit(
  * @see image_effect_form_submit()
  */
 function image_effect_form($form, &$form_state, $style, $effect) {
-  if (!empty($effect['data'])) {
-    $title = t('Edit %label effect', array('%label' => $effect['label']));
-  }
-  else{
-    $title = t('Add %label effect', array('%label' => $effect['label']));
-  }
-  drupal_set_title($title, PASS_THROUGH);
-
   $form_state['image_style'] = $style;
   $form_state['image_effect'] = $effect;
 
Index: modules/image/image.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.module,v
retrieving revision 1.47
diff -u -p -r1.47 image.module
--- modules/image/image.module	22 Aug 2010 22:04:18 -0000	1.47
+++ modules/image/image.module	24 Aug 2010 14:16:23 -0000
@@ -120,6 +120,9 @@ function image_menu() {
   );
   $items['admin/config/media/image-styles/edit/%image_style'] = array(
     'title' => 'Edit style',
+    'title callback' => 'image_menu_title_style_edit',
+    'title arguments' => array(5),
+    'title output' => PASS_THROUGH,
     'description' => 'Configure an image style.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('image_style_form', 5),
@@ -149,6 +152,9 @@ function image_menu() {
   );
   $items['admin/config/media/image-styles/edit/%image_style/effects/%image_effect'] = array(
     'title' => 'Edit image effect',
+    'title callback' => 'image_menu_title_effect',
+    'title arguments' => array(7),
+    'title output' => PASS_THROUGH,
     'description' => 'Edit an existing effect within a style.',
     'load arguments' => array(5, (string) IMAGE_STORAGE_EDITABLE),
     'page callback' => 'drupal_get_form',
@@ -169,6 +175,9 @@ function image_menu() {
   );
   $items['admin/config/media/image-styles/edit/%image_style/add/%image_effect_definition'] = array(
     'title' => 'Add image effect',
+    'title callback' => 'image_menu_title_effect_edit',
+    'title arguments' => array(7),
+    'title output' => PASS_THROUGH,
     'description' => 'Add a new effect to a style.',
     'load arguments' => array(5),
     'page callback' => 'drupal_get_form',
@@ -182,6 +191,25 @@ function image_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function image_menu_title_style_edit($style) {
+  return t('Edit %name style', array('%name' => $style['name']));
+}
+
+/**
+ * Menu title callback.
+ */
+function image_menu_title_effect_edit($effect) {
+  if (!empty($effect['data'])) {
+    return t('Edit %label effect', array('%label' => $effect['label']));
+  }
+  else{
+    return t('Add %label effect', array('%label' => $effect['label']));
+  }
+}
+
+/**
  * Implements hook_theme().
  */
 function image_theme() {
Index: modules/menu/menu.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v
retrieving revision 1.83
diff -u -p -r1.83 menu.admin.inc
--- modules/menu/menu.admin.inc	1 Aug 2010 23:33:18 -0000	1.83
+++ modules/menu/menu.admin.inc	24 Aug 2010 13:46:31 -0000
@@ -51,7 +51,7 @@ function menu_overview_form($form, &$for
   global $menu_admin;
   $form['#attached']['css'] = array(drupal_get_path('module', 'menu') . '/menu.css');
   $sql = "
-    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*
+    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.title_output, m.type, m.description, ml.*
     FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
     WHERE ml.menu_name = :menu
     ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC";
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.95
diff -u -p -r1.95 openid.module
--- modules/openid/openid.module	22 Aug 2010 22:00:16 -0000	1.95
+++ modules/openid/openid.module	24 Aug 2010 14:20:42 -0000
@@ -19,6 +19,8 @@ function openid_menu() {
   );
   $items['user/%user/openid'] = array(
     'title' => 'OpenID identities',
+    'title callback' => 'user_page_title',
+    'title arguments' => array(1),
     'page callback' => 'openid_user_identities',
     'page arguments' => array(1),
     'access callback' => 'user_edit_access',
Index: modules/openid/openid.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.pages.inc,v
retrieving revision 1.28
diff -u -p -r1.28 openid.pages.inc
--- modules/openid/openid.pages.inc	24 Apr 2010 14:49:14 -0000	1.28
+++ modules/openid/openid.pages.inc	24 Aug 2010 14:20:50 -0000
@@ -28,7 +28,6 @@ function openid_authentication_page() {
  * Menu callback; Manage OpenID identities for the specified user.
  */
 function openid_user_identities($account) {
-  drupal_set_title(format_username($account));
   drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css');
 
   // Check to see if we got a response
Index: modules/path/path.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v
retrieving revision 1.44
diff -u -p -r1.44 path.admin.inc
--- modules/path/path.admin.inc	14 May 2010 04:57:59 -0000	1.44
+++ modules/path/path.admin.inc	24 Aug 2010 14:25:42 -0000
@@ -88,21 +88,6 @@ function path_admin_overview($keys = NUL
 }
 
 /**
- * Menu callback; handles pages for creating and editing URL aliases.
- */
-function path_admin_edit($path = array()) {
-  if ($path) {
-    drupal_set_title($path['alias']);
-    $output = drupal_get_form('path_admin_form', $path);
-  }
-  else {
-    $output = drupal_get_form('path_admin_form');
-  }
-
-  return $output;
-}
-
-/**
  * Return a form for editing or creating an individual URL alias.
  *
  * @ingroup forms
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.183
diff -u -p -r1.183 path.module
--- modules/path/path.module	13 Feb 2010 21:41:58 -0000	1.183
+++ modules/path/path.module	24 Aug 2010 14:25:28 -0000
@@ -63,8 +63,11 @@ function path_menu() {
   );
   $items['admin/config/search/path/edit/%path'] = array(
     'title' => 'Edit alias',
-    'page callback' => 'path_admin_edit',
-    'page arguments' => array(5),
+    'title callback' => 'path_menu_title_edit',
+    'title arguments' => array(5),
+    'title output' => PASS_THROUGH,
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('path_admin_form', 5),
     'access arguments' => array('administer url aliases'),
     'type' => MENU_CALLBACK,
     'file' => 'path.admin.inc',
@@ -84,7 +87,9 @@ function path_menu() {
   );
   $items['admin/config/search/path/add'] = array(
     'title' => 'Add alias',
-    'page callback' => 'path_admin_edit',
+    'title callback' => 'path_menu_title_edit',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('path_admin_form'),
     'access arguments' => array('administer url aliases'),
     'type' => MENU_LOCAL_ACTION,
     'file' => 'path.admin.inc',
@@ -94,6 +99,18 @@ function path_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function path_menu_title_edit($path = NULL) {
+  if (isset($path)) {
+    return t('Edit alias %alias', array('%alias' => $path['alias']));
+  }
+  else {
+    return t('Add alias');
+  }
+}
+
+/**
  * Implements hook_form_alter().
  */
 function path_form_alter(&$form, $form_state, $form_id) {
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.354
diff -u -p -r1.354 poll.module
--- modules/poll/poll.module	30 Jul 2010 02:47:28 -0000	1.354
+++ modules/poll/poll.module	24 Aug 2010 14:27:06 -0000
@@ -105,6 +105,8 @@ function poll_menu() {
 
   $items['node/%node/votes'] = array(
     'title' => 'Votes',
+    'title callback' => 'node_page_title',
+    'title arguments' => array(1),
     'page callback' => 'poll_votes',
     'page arguments' => array(1),
     'access callback' => '_poll_menu_access',
@@ -116,6 +118,8 @@ function poll_menu() {
 
   $items['node/%node/results'] = array(
     'title' => 'Results',
+    'title callback' => 'node_page_title',
+    'title arguments' => array(1),
     'page callback' => 'poll_results',
     'page arguments' => array(1),
     'access callback' => '_poll_menu_access',
Index: modules/poll/poll.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v
retrieving revision 1.27
diff -u -p -r1.27 poll.pages.inc
--- modules/poll/poll.pages.inc	9 Jan 2010 21:54:01 -0000	1.27
+++ modules/poll/poll.pages.inc	24 Aug 2010 14:27:09 -0000
@@ -51,7 +51,6 @@ function poll_page() {
  */
 function poll_votes($node) {
   $votes_per_page = 20;
-  drupal_set_title($node->title);
 
   $header[] = array('data' => t('Visitor'), 'field' => 'u.name');
   $header[] = array('data' => t('Vote'), 'field' => 'pc.chtext');
@@ -92,7 +91,6 @@ function poll_votes($node) {
  * Callback for the 'results' tab for polls you can vote on
  */
 function poll_results($node) {
-  drupal_set_title($node->title);
   $node->show_results = TRUE;
   return node_show($node);
 }
Index: modules/shortcut/shortcut.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.admin.inc,v
retrieving revision 1.14
diff -u -p -r1.14 shortcut.admin.inc
--- modules/shortcut/shortcut.admin.inc	30 Jun 2010 15:12:59 -0000	1.14
+++ modules/shortcut/shortcut.admin.inc	24 Aug 2010 14:30:23 -0000
@@ -406,7 +406,6 @@ function theme_shortcut_set_customize($v
  * @see shortcut_link_add_submit()
  */
 function shortcut_link_add($form, &$form_state, $shortcut_set) {
-  drupal_set_title(t('Add new shortcut'));
   $form['shortcut_set'] = array(
     '#type' => 'value',
     '#value' => $shortcut_set,
@@ -433,7 +432,6 @@ function shortcut_link_add($form, &$form
  * @see shortcut_link_edit_submit()
  */
 function shortcut_link_edit($form, &$form_state, $shortcut_link) {
-  drupal_set_title(t('Editing @shortcut', array('@shortcut' => $shortcut_link['link_title'])));
   $form['original_shortcut_link'] = array(
     '#type' => 'value',
     '#value' => $shortcut_link,
Index: modules/shortcut/shortcut.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.module,v
retrieving revision 1.26
diff -u -p -r1.26 shortcut.module
--- modules/shortcut/shortcut.module	3 Aug 2010 23:07:01 -0000	1.26
+++ modules/shortcut/shortcut.module	24 Aug 2010 14:30:20 -0000
@@ -118,7 +118,7 @@ function shortcut_menu() {
     'file' => 'shortcut.admin.inc',
   );
   $items['admin/config/user-interface/shortcut/%shortcut_set/add-link'] = array(
-    'title' => 'Add shortcut',
+    'title' => 'Add new shortcut',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('shortcut_link_add', 4),
     'access callback' => 'shortcut_set_edit_access',
@@ -127,7 +127,7 @@ function shortcut_menu() {
     'file' => 'shortcut.admin.inc',
   );
   $items['admin/config/user-interface/shortcut/%shortcut_set/add-link-inline'] = array(
-    'title' => 'Add shortcut',
+    'title' => 'Add new shortcut',
     'page callback' => 'shortcut_link_add_inline',
     'page arguments' => array(4),
     'access callback' => 'shortcut_set_edit_access',
@@ -137,6 +137,9 @@ function shortcut_menu() {
   );
   $items['admin/config/user-interface/shortcut/link/%menu_link'] = array(
     'title' => 'Edit shortcut',
+    'title callback' => 'shortcut_menu_title_edit',
+    'title arguments' => array(5),
+    'title output' => PASS_THROUGH,
     'page callback' => 'drupal_get_form',
     'page arguments' => array('shortcut_link_edit', 5),
     'access callback' => 'shortcut_link_access',
@@ -167,6 +170,13 @@ function shortcut_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function shortcut_menu_title_edit($shortcut_link) {
+  return t('Edit %shortcut', array('%shortcut' => $shortcut_link['link_title']));
+}
+
+/**
  * Implements hook_admin_paths().
  */
 function shortcut_admin_paths() {
Index: modules/simpletest/tests/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v
retrieving revision 1.34
diff -u -p -r1.34 menu.test
--- modules/simpletest/tests/menu.test	8 Aug 2010 19:35:49 -0000	1.34
+++ modules/simpletest/tests/menu.test	24 Aug 2010 13:46:31 -0000
@@ -35,6 +35,15 @@ class MenuRouterTestCase extends DrupalW
   }
 
   /**
+   * Test title_output.
+   */
+  function testPassthrough() {
+    $this->drupalGet('node');
+    $this->assertRaw('<strong>strong</strong>', 'title_output PASS_THROUGH works');
+    $this->assertNoRaw('<em>weak</em>', 'Omitting title_output leads to check_plain.');
+  }
+
+  /**
    * Test the theme callback when it is set to use an administrative theme.
    */
   function testThemeCallbackAdministrative() {
Index: modules/simpletest/tests/menu_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu_test.module,v
retrieving revision 1.15
diff -u -p -r1.15 menu_test.module
--- modules/simpletest/tests/menu_test.module	7 Jul 2010 08:05:01 -0000	1.15
+++ modules/simpletest/tests/menu_test.module	24 Aug 2010 13:46:31 -0000
@@ -24,6 +24,18 @@ function menu_test_menu() {
     'page callback' => 'menu_test_callback',
     'access arguments' => array('access content'),
   );
+  // Check passthrough
+  $items['menu_passthrough/1'] = array(
+    'title' => '<strong>strong</strong>',
+    'title output' => PASS_THROUGH,
+    'page callback' => 'menu_test_callback',
+    'access callback' => TRUE,
+  );
+  $items['menu_passthrough/2'] = array(
+    'title' => '<em>weak</em>',
+    'page callback' => 'menu_test_callback',
+    'access callback' => TRUE,
+  );
 
   // Hidden link for menu_link_maintain tests
   $items['menu_test_maintain/%'] = array(
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.337
diff -u -p -r1.337 statistics.module
--- modules/statistics/statistics.module	10 Jul 2010 01:44:28 -0000	1.337
+++ modules/statistics/statistics.module	24 Aug 2010 14:33:48 -0000
@@ -184,7 +184,10 @@ function statistics_menu() {
   );
   $items['user/%user/track/navigation'] = array(
     'title' => 'Track page visits',
+    'title callback' => 'user_page_title',
+    'title arguments' => array(1),
     'page callback' => 'statistics_user_tracker',
+    'page arguments' => array(1),
     'access callback' => 'user_access',
     'access arguments' => array('access statistics'),
     'type' => MENU_LOCAL_TASK,
@@ -193,7 +196,10 @@ function statistics_menu() {
   );
   $items['node/%node/track'] = array(
     'title' => 'Track',
+    'title callback' => 'node_page_title',
+    'title arguments' => array(1),
     'page callback' => 'statistics_node_tracker',
+    'page arguments' => array(1),
     'access callback' => 'user_access',
     'access arguments' => array('access statistics'),
     'type' => MENU_LOCAL_TASK,
Index: modules/statistics/statistics.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.pages.inc,v
retrieving revision 1.23
diff -u -p -r1.23 statistics.pages.inc
--- modules/statistics/statistics.pages.inc	9 Jan 2010 21:54:01 -0000	1.23
+++ modules/statistics/statistics.pages.inc	24 Aug 2010 14:34:30 -0000
@@ -6,87 +6,80 @@
  * User page callbacks for the statistics module.
  */
 
-function statistics_node_tracker() {
-  if ($node = node_load(arg(1))) {
-
-    $header = array(
-        array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
-        array('data' => t('Referrer'), 'field' => 'a.url'),
-        array('data' => t('User'), 'field' => 'u.name'),
-        array('data' => t('Operations')));
-
-    $query = db_select('accesslog', 'a', array('target' => 'slave'))->extend('PagerDefault')->extend('TableSort');
-    $query->join('users', 'u', 'a.uid = u.uid');
-
-    $query
-      ->fields('a', array('aid', 'timestamp', 'url', 'uid'))
-      ->fields('u', array('name'))
-      ->condition(db_or()
-        ->condition('a.path', 'node/' . $node->nid)
-        ->condition('a.path', 'node/' . $node->nid . '/%', 'LIKE'))
-      ->limit(30)
-      ->orderByHeader($header);
-
-    $result = $query->execute();
-    $rows = array();
-    foreach ($result as $log) {
-      $rows[] = array(
-        array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
-        _statistics_link($log->url),
-        theme('username', array('account' => $log)),
-        l(t('details'), "admin/reports/access/$log->aid"),
-      );
-    }
-
-    drupal_set_title($node->title);
-    $build['statistics_table'] = array(
-      '#theme' => 'table',
-      '#header' => $header,
-      '#rows' => $rows,
-      '#empty' => t('No statistics available.'),
+function statistics_node_tracker($node) {
+  $header = array(
+      array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
+      array('data' => t('Referrer'), 'field' => 'a.url'),
+      array('data' => t('User'), 'field' => 'u.name'),
+      array('data' => t('Operations')),
+  );
+
+  $query = db_select('accesslog', 'a', array('target' => 'slave'))
+    ->extend('PagerDefault')
+    ->extend('TableSort');
+  $query->join('users', 'u', 'a.uid = u.uid');
+  $query
+    ->fields('a', array('aid', 'timestamp', 'url', 'uid'))
+    ->fields('u', array('name'))
+    ->condition(db_or()
+      ->condition('a.path', 'node/' . $node->nid)
+      ->condition('a.path', 'node/' . $node->nid . '/%', 'LIKE')
+    )
+    ->limit(30)
+    ->orderByHeader($header);
+
+  $result = $query->execute();
+  $rows = array();
+  foreach ($result as $log) {
+    $rows[] = array(
+      array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
+      _statistics_link($log->url),
+      theme('username', array('account' => $log)),
+      l(t('details'), "admin/reports/access/$log->aid"),
     );
-    $build['statistics_pager'] = array('#theme' => 'pager');
-    return $build;
-  }
-  else {
-    drupal_not_found();
   }
-}
 
-function statistics_user_tracker() {
-  if ($account = user_load(arg(1))) {
+  $build['statistics_table'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#empty' => t('No statistics available.'),
+  );
+  $build['statistics_pager'] = array('#theme' => 'pager');
+  return $build;
+}
 
-    $header = array(
-        array('data' => t('Timestamp'), 'field' => 'timestamp', 'sort' => 'desc'),
-        array('data' => t('Page'), 'field' => 'path'),
-        array('data' => t('Operations')));
-    $query = db_select('accesslog', 'a', array('target' => 'slave'))->extend('PagerDefault')->extend('TableSort');
-    $query
-      ->fields('a', array('aid', 'timestamp', 'path', 'title'))
-      ->condition('uid', $account->uid)
-      ->limit(30)
-      ->orderByHeader($header);
-
-    $result = $query->execute();
-    $rows = array();
-    foreach ($result as $log) {
-      $rows[] = array(
-        array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
-        _statistics_format_item($log->title, $log->path),
-        l(t('details'), "admin/reports/access/$log->aid"));
-    }
-
-    drupal_set_title(format_username($account));
-    $build['statistics_table'] = array(
-      '#theme' => 'table',
-      '#header' => $header,
-      '#rows' => $rows,
-      '#empty' => t('No statistics available.'),
+function statistics_user_tracker($account) {
+  $header = array(
+      array('data' => t('Timestamp'), 'field' => 'timestamp', 'sort' => 'desc'),
+      array('data' => t('Page'), 'field' => 'path'),
+      array('data' => t('Operations')),
+  );
+  $query = db_select('accesslog', 'a', array('target' => 'slave'))
+    ->extend('PagerDefault')
+    ->extend('TableSort');
+  $query
+    ->fields('a', array('aid', 'timestamp', 'path', 'title'))
+    ->condition('uid', $account->uid)
+    ->limit(30)
+    ->orderByHeader($header);
+
+  $result = $query->execute();
+  $rows = array();
+  foreach ($result as $log) {
+    $rows[] = array(
+      array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
+      _statistics_format_item($log->title, $log->path),
+      l(t('details'), "admin/reports/access/$log->aid"),
     );
-    $build['statistics_pager'] = array('#theme' => 'pager');
-    return $build;
-  }
-  else {
-    drupal_not_found();
   }
+
+  $build['statistics_table'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#empty' => t('No statistics available.'),
+  );
+  $build['statistics_pager'] = array('#theme' => 'pager');
+  return $build;
 }
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.187
diff -u -p -r1.187 system.api.php
--- modules/system/system.api.php	22 Aug 2010 13:55:53 -0000	1.187
+++ modules/system/system.api.php	24 Aug 2010 13:46:31 -0000
@@ -872,6 +872,8 @@ function hook_page_build(&$page) {
  *     If you require only the raw string to be output, set this to FALSE.
  *   - "title arguments": Arguments to send to t() or your custom callback,
  *     with path component substitution as described above.
+ *   - "title output": CHECK_PLAIN to run the title through check_plain or
+ *     PASS_THROUGH to output as is. Defaults to CHECK_PLAIN.
  *   - "description": The untranslated description of the menu item.
  *   - "page callback": The function to call to display a web page when the user
  *     visits the path. If omitted, the parent menu item's callback will be used
@@ -3946,7 +3948,7 @@ function hook_filetransfer_backends() {
 /**
  * Control site status before menu dispatching.
  *
- * The hook is called after checking whether the site is offline but before 
+ * The hook is called after checking whether the site is offline but before
  * the current router item is retrieved and executed by
  * menu_execute_active_handler(). If the site is in offline mode,
  * $menu_site_status is set to MENU_SITE_OFFLINE.
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.499
diff -u -p -r1.499 system.install
--- modules/system/system.install	23 Aug 2010 14:56:37 -0000	1.499
+++ modules/system/system.install	24 Aug 2010 14:41:59 -0000
@@ -1049,6 +1049,12 @@ function system_schema() {
         'not null' => TRUE,
         'default' => '',
       ),
+      'title_output' => array(
+        'description' => "Whether the title should be check_plain'd (CHECK_PLAIN) or displayed as-is (PASS_THROUGH).",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => CHECK_PLAIN,
+      ),
       'theme_callback' => array(
         'description' => 'A function which returns the name of the theme that will be used to render this page. If left empty, the default theme will be used.',
         'type' => 'varchar',
@@ -2885,6 +2891,19 @@ function system_update_7060() {
 }
 
 /**
+ * Add the title_output field to the menu_router table.
+ */
+function system_update_7061() {
+  $spec = array(
+    'description' => "Whether the title should be check_plain'd (CHECK_PLAIN) or displayed as-is (PASS_THROUGH).",
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => CHECK_PLAIN,
+  );
+  db_add_field('menu_router', 'title_output', $spec);
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.957
diff -u -p -r1.957 system.module
--- modules/system/system.module	22 Aug 2010 13:52:58 -0000	1.957
+++ modules/system/system.module	24 Aug 2010 13:46:31 -0000
@@ -2020,7 +2020,7 @@ function system_admin_menu_block($item) 
   $default_task = NULL;
   $has_subitems = FALSE;
   $result = db_query("
-    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, ml.*
+    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.title_output, m.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, ml.*
     FROM {menu_router} m
     LEFT JOIN {menu_links} ml ON m.path = ml.router_path
     WHERE (ml.plid = :plid AND ml.menu_name = :name AND hidden = 0) OR (m.tab_parent = :path AND m.type IN (:local_task, :default_task))", array(':plid' => $item['mlid'], ':name' => $item['menu_name'], ':path' => $item['path'], ':local_task' => MENU_LOCAL_TASK, ':default_task' => MENU_DEFAULT_LOCAL_TASK), array('fetch' => PDO::FETCH_ASSOC));
@@ -2769,7 +2769,7 @@ function system_get_module_admin_tasks($
 
   if (empty($items)) {
     $result = db_query("
-       SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, ml.*
+       SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.title_output, m.theme_callback, m.theme_arguments, m.type, ml.*
        FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path WHERE ml.link_path LIKE 'admin/%' AND hidden >= 0 AND module = 'system' AND m.number_parts > 2", array(), array('fetch' => PDO::FETCH_ASSOC));
     foreach ($result as $item) {
       _menu_link_translate($item);
Index: modules/translation/translation.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v
retrieving revision 1.82
diff -u -p -r1.82 translation.module
--- modules/translation/translation.module	5 Aug 2010 08:08:43 -0000	1.82
+++ modules/translation/translation.module	24 Aug 2010 14:37:56 -0000
@@ -56,9 +56,11 @@ function translation_help($path, $arg) {
  * Implements hook_menu().
  */
 function translation_menu() {
-  $items = array();
   $items['node/%node/translate'] = array(
     'title' => 'Translate',
+    'title callback' => 'translation_menu_title_translations',
+    'title arguments' => array(1),
+    'title output' => PASS_THROUGH,
     'page callback' => 'translation_node_overview',
     'page arguments' => array(1),
     'access callback' => '_translation_tab_access',
@@ -72,6 +74,13 @@ function translation_menu() {
 }
 
 /**
+ * Menu title callback.
+ */
+function translation_menu_title_translations($node) {
+  return t('Translations of %title', array('%title' => $node->title));
+}
+
+/**
  * Menu access callback.
  *
  * Only display translation tab for node types, which have translation enabled
Index: modules/translation/translation.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.pages.inc,v
retrieving revision 1.16
diff -u -p -r1.16 translation.pages.inc
--- modules/translation/translation.pages.inc	17 Jul 2010 11:31:36 -0000	1.16
+++ modules/translation/translation.pages.inc	24 Aug 2010 14:37:57 -0000
@@ -54,8 +54,6 @@ function translation_node_overview($node
     $rows[] = array($language_name, $title, $status, implode(" | ", $options));
   }
 
-  drupal_set_title(t('Translations of %title', array('%title' => $node->title)), PASS_THROUGH);
-
   $build['translation_node_overview'] = array(
     '#theme' => 'table',
     '#header' => $header,
