=== modified file 'includes/bootstrap.inc'
--- includes/bootstrap.inc	2010-07-26 03:05:36 +0000
+++ includes/bootstrap.inc	2010-08-07 04:23:25 +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;

=== modified file 'includes/menu.inc'
--- includes/menu.inc	2010-08-05 07:56:50 +0000
+++ includes/menu.inc	2010-08-07 08:45:11 +0000
@@ -658,15 +658,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['passthrough']) {
+    $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
       'theme_arguments',
       'type',
       'description',
+      'passthrough',
     ));
     for ($i = 1; $i <= MENU_MAX_DEPTH; $i++) {
       $query->orderBy('p' . $i, 'ASC');
@@ -2115,7 +2116,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, 'passthrough' => 0);
     $item = menu_get_item();
 
     // Check whether the current item is a local task (displayed as a tab).
@@ -2230,7 +2231,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['passthrough'] ? $item['title'] : check_plain($item['title']);
     }
   }
 }
@@ -3274,6 +3275,7 @@ function _menu_router_build($callbacks) 
       'file path' => '',
       'include file' => '',
       'module' => '',
+      'passthrough' => FALSE,
     );
 
     // Calculate out the file to be included for each callback, if any.
@@ -3324,6 +3326,7 @@ function _menu_router_save($menu, $masks
       'position',
       'weight',
       'include_file',
+      'passthrough',
     ));
 
   $num_records = 0;
@@ -3355,6 +3358,7 @@ function _menu_router_save($menu, $masks
       'position' => $item['position'],
       'weight' => $item['weight'],
       'include_file' => $item['include file'],
+      'passthrough' => (int) $item['passthrough'],
     ));
 
     // Execute in batches to avoid the memory overhead of all of those records

=== modified file 'modules/book/book.module'
--- modules/book/book.module	2010-07-30 02:47:27 +0000
+++ modules/book/book.module	2010-08-07 05:09:58 +0000
@@ -1279,7 +1279,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', 'type', 'passthrough'));
       $query->fields('ml');
       $query->condition('menu_name', $link['menu_name']);
       for ($i = 1; $i <= MENU_MAX_DEPTH && $link["p$i"]; ++$i) {

=== modified file 'modules/menu/menu.admin.inc'
--- modules/menu/menu.admin.inc	2010-08-01 23:33:18 +0000
+++ modules/menu/menu.admin.inc	2010-08-07 05:09:21 +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.type, m.description, m.passthrough, 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";

=== modified file 'modules/simpletest/tests/menu.test'
--- modules/simpletest/tests/menu.test	2010-08-05 23:53:37 +0000
+++ modules/simpletest/tests/menu.test	2010-08-07 05:08:04 +0000
@@ -35,6 +35,15 @@ class MenuRouterTestCase extends DrupalW
   }
 
   /**
+   * Test the passthrough flag.
+   */
+  function testPassthrough() {
+    $this->drupalGet('node');
+    $this->assertRaw('<strong>strong</strong>', 'Passthrough TRUE works');
+    $this->assertNoRaw('<em>weak</em>', 'Omitting passthrough leads to check_plain.');
+  }
+
+  /**
    * Test the theme callback when it is set to use an administrative theme.
    */
   function testThemeCallbackAdministrative() {

=== modified file 'modules/simpletest/tests/menu_test.module'
--- modules/simpletest/tests/menu_test.module	2010-07-07 08:05:01 +0000
+++ modules/simpletest/tests/menu_test.module	2010-08-07 05:03:34 +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>',
+    'passthrough' => TRUE,
+    '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(

=== modified file 'modules/system/system.api.php'
--- modules/system/system.api.php	2010-08-05 08:05:06 +0000
+++ modules/system/system.api.php	2010-08-07 05:05:02 +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.
+ *   - "passthrough": When TRUE, the title is not run through check_plain.
+ *     Defaults to FALSE.
  *   - "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
@@ -3962,7 +3964,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.

=== modified file 'modules/system/system.install'
--- modules/system/system.install	2010-07-31 12:29:31 +0000
+++ modules/system/system.install	2010-08-07 04:36:34 +0000
@@ -1059,6 +1059,12 @@ function system_schema() {
         'type' => 'text',
         'size' => 'medium',
       ),
+      'passthrough' => array(
+        'description' => "Boolean indicating whether the title should be passed through (TRUE) or check_plain'd (FALSE).",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
     ),
     'indexes' => array(
       'fit' => array('fit'),
@@ -2786,6 +2792,19 @@ function system_update_7059(&$sandbox) {
 }
 
 /**
+ * Add a passthrough flag to the menu_router table.
+ */
+function system_update_7060() {
+  $spec = array(
+    'description' => "Boolean indicating whether the title should be passed through (TRUE) or check_plain'd (FALSE).",
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+  );
+  db_add_field('menu_router', 'passthrough', $spec);
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */

=== modified file 'modules/system/system.module'
--- modules/system/system.module	2010-08-03 02:06:42 +0000
+++ modules/system/system.module	2010-08-07 05:10:34 +0000
@@ -2001,7 +2001,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.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, m.passthrough, 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));
@@ -2750,7 +2750,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.theme_callback, m.theme_arguments, m.type, m.passthrough, 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);

