? token_profile.inc
Index: token.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/token.module,v
retrieving revision 1.7.4.20
diff -u -p -r1.7.4.20 token.module
--- token.module	26 Mar 2010 00:03:19 -0000	1.7.4.20
+++ token.module	5 Jun 2010 16:28:01 -0000
@@ -114,19 +114,20 @@ function token_token_list($type = 'all')
 
 /**
  * General function to include the files that token relies on for the real work.
- *
  */
 function token_include() {
-  $path = drupal_get_path('module', 'token');
-  require_once("$path/token_node.inc");
-  require_once("$path/token_user.inc");
-  if (module_exists('taxonomy')) {
-    require_once("$path/token_taxonomy.inc");
-  }
-  if (module_exists('comment')) {
-    require_once("$path/token_comment.inc");
-  }
+  static $run;
 
+  if (!isset($run)) {
+    $modules_enabled = array_keys(module_list());
+    $modules = array('node', 'user', 'taxonomy', 'comment');
+    $modules = array_intersect($modules, $modules_enabled);
+    foreach ($modules as $module) {
+      module_load_include('inc', 'token', "token_$module");
+    }
+
+    $run = TRUE;
+  }
 }
 
 /**
@@ -324,6 +325,10 @@ function token_get_list($types = 'all') 
       if (is_array($result)) {
         foreach ($result as $category => $tokens) {
           foreach ($tokens as $token => $title) {
+            // Automatically append a raw token warning.
+            if (substr($token, -4) === '-raw' && strpos($title, t('raw user input')) === FALSE && strpos($title, '1269441371') === FALSE) {
+              $title .= ' <em>' . t('Warning: Token value contains raw user input.') . '</em>';
+            }
             $return[$category][$token] = $title;
           }
         }
Index: token_comment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_comment.inc,v
retrieving revision 1.3.4.7
diff -u -p -r1.3.4.7 token_comment.inc
--- token_comment.inc	9 Apr 2010 18:39:52 -0000	1.3.4.7
+++ token_comment.inc	5 Jun 2010 16:28:01 -0000
@@ -67,17 +67,17 @@ function comment_token_list($type = 'all
     $tokens['comment']['comment-cid']             = t('Comment ID');
     $tokens['comment']['comment-nid']             = t("Comment's node ID");
     $tokens['comment']['comment-title']           = t('Comment title');
-    $tokens['comment']['comment-title-raw']       = t('Comment title. WARNING - raw user input');
+    $tokens['comment']['comment-title-raw']       = t('Comment title.');
     $tokens['comment']['comment-body']            = t('Comment body');
-    $tokens['comment']['comment-body-raw']        = t('Comment body. WARNING - raw user input');
+    $tokens['comment']['comment-body-raw']        = t('Comment body.');
 
     $tokens['comment']['comment-author-uid']      = t("Comment author's user id");
     $tokens['comment']['comment-author-name']     = t("Comment author's user name");
-    $tokens['comment']['comment-author-name-raw'] = t("Comment author's user name. WARNING - raw user input");
+    $tokens['comment']['comment-author-name-raw'] = t("Comment author's user name.");
     $tokens['comment']['comment-author-homepage'] = t("Comment author's home page.");
 
     $tokens['comment']['comment-author-mail']     = t("Comment author's e-mail.");
-    $tokens['comment']['comment-author-mail-raw'] = t("Comment author's e-mail. WARNING - raw user input.");
+    $tokens['comment']['comment-author-mail-raw'] = t("Comment author's e-mail.");
 
     $tokens['comment'] += token_get_date_token_info(t('Comment creation'), 'comment-');
 
Index: token_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_node.inc,v
retrieving revision 1.5.4.21
diff -u -p -r1.5.4.21 token_node.inc
--- token_node.inc	25 Mar 2010 17:49:43 -0000	1.5.4.21
+++ token_node.inc	5 Jun 2010 16:28:01 -0000
@@ -166,21 +166,21 @@ function node_token_list($type = 'all') 
     $tokens['node']['type-name']       = t('Node type (user-friendly version)');
     $tokens['node']['language']        = t('Node language');
     $tokens['node']['title']           = t('Node title');
-    $tokens['node']['title-raw']       = t('Unfiltered node title. WARNING - raw user input.');
+    $tokens['node']['title-raw']       = t('Unfiltered node title.');
 
     $tokens['node']['author-uid']      = t("Node author's user id");
     $tokens['node']['author-name']     = t("Node author's user name");
-    $tokens['node']['author-name-raw'] = t("Node author's user name. WARNING - raw user input.");
+    $tokens['node']['author-name-raw'] = t("Node author's user name.");
     $tokens['node']['author-mail']     = t("Node author's e-mail.");
-    $tokens['node']['author-mail-raw'] = t("Node author's e-mail. WARNING - raw user input.");
+    $tokens['node']['author-mail-raw'] = t("Node author's e-mail.");
     $tokens['node']['node_comment_count'] = t("The number of comments on a node.");
     $tokens['node']['unread_comment_count'] = t("The number of new comments on a node.");
 
     $tokens['node']['term']            = t("Name of top taxonomy term");
-    $tokens['node']['term-raw']        = t("Unfiltered name of top taxonomy term. WARNING - raw user input.");
+    $tokens['node']['term-raw']        = t("Unfiltered name of top taxonomy term.");
     $tokens['node']['term-id']         = t("ID of top taxonomy term");
     $tokens['node']['vocab']           = t("Name of top term's vocabulary");
-    $tokens['node']['vocab-raw']       = t("Unfiltered name of top term's vocabulary. WARNING - raw user input.");
+    $tokens['node']['vocab-raw']       = t("Unfiltered name of top term's vocabulary.");
     $tokens['node']['vocab-id']        = t("ID of top term's vocabulary");
 
     // Temporarily disabled -- see notes in node_token_values.
@@ -190,11 +190,11 @@ function node_token_list($type = 'all') 
     $tokens['node']['mod-????']        = t('All tokens for node creation dates can also be used with with the "mod-" prefix; doing so will use the modification date rather than the creation date.');
 
     $tokens['node']['menu']                = t("The name of the menu the node belongs to.");
-    $tokens['node']['menu-raw']            = t("The name of the menu the node belongs to. WARNING - raw user input.");
+    $tokens['node']['menu-raw']            = t("The name of the menu the node belongs to.");
     $tokens['node']['menupath']            = t("The menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /.");
-    $tokens['node']['menupath-raw']        = t("The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /. WARNING - raw user input.");
+    $tokens['node']['menupath-raw']        = t("The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /.");
     $tokens['node']['menu-link-title']     = t("The text used in the menu as link text for this item.");
-    $tokens['node']['menu-link-title-raw'] = t("The unfiltered text used in the menu as link text for this item. WARNING - raw user input.");
+    $tokens['node']['menu-link-title-raw'] = t("The unfiltered text used in the menu as link text for this item.");
 
     return $tokens;
   }
@@ -284,8 +284,8 @@ function book_token_list($type) {
     $list['book']['book_id']        = t("The id of the node's book parent.");
     $list['book']['bookpath']       = t("The titles of all parents in the node's book hierarchy.");
 
-    $list['book']['book-raw']       = t("The unfiltered title of the node's book parent. WARNING - raw user input.");
-    $list['book']['bookpath-raw']   = t("The unfiltered titles of all parents in the node's book hierarchy. WARNING - raw user input.");
+    $list['book']['book-raw']       = t("The unfiltered title of the node's book parent.");
+    $list['book']['bookpath-raw']   = t("The unfiltered titles of all parents in the node's book hierarchy.");
 
     return $list;
   }
Index: token_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_taxonomy.inc,v
retrieving revision 1.3.4.4
diff -u -p -r1.3.4.4 token_taxonomy.inc
--- token_taxonomy.inc	25 Mar 2010 20:18:50 -0000	1.3.4.4
+++ token_taxonomy.inc	5 Jun 2010 16:28:01 -0000
@@ -46,11 +46,11 @@ function taxonomy_token_list($type = 'al
   if ($type == 'taxonomy' || $type == 'all') {
     $tokens['taxonomy']['tid'] = t('The id number of the category.');
     $tokens['taxonomy']['cat'] = t('The name of the category.');
-    $tokens['taxonomy']['cat-raw'] = t('The unfiltered name of the category. WARNING - raw user input.');
+    $tokens['taxonomy']['cat-raw'] = t('The unfiltered name of the category.');
     $tokens['taxonomy']['cat-description'] = t('The optional description of the taxonomy term.');
     $tokens['taxonomy']['vid'] = t("The id number of the category's parent vocabulary.");
     $tokens['taxonomy']['vocab'] = t("The vocabulary that the page's first category belongs to.");
-    $tokens['taxonomy']['vocab-raw'] = t("The unfiltered vocabulary that the page's first category belongs to. WARNING - raw user input.");
+    $tokens['taxonomy']['vocab-raw'] = t("The unfiltered vocabulary that the page's first category belongs to.");
     $tokens['taxonomy']['vocab-description'] = t('The optional description of the taxonomy vocabulary.');
 
     return $tokens;
Index: token_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_user.inc,v
retrieving revision 1.3.4.6
diff -u -p -r1.3.4.6 token_user.inc
--- token_user.inc	5 Jun 2010 15:52:32 -0000	1.3.4.6
+++ token_user.inc	5 Jun 2010 16:28:01 -0000
@@ -57,7 +57,7 @@ function user_token_values($type, $objec
 function user_token_list($type = 'all') {
   if ($type == 'user' || $type == 'all') {
     $tokens['user']['user']           = t("User's name");
-    $tokens['user']['user-raw']       = t("User's unfiltered name. WARNING - raw user input.");
+    $tokens['user']['user-raw']       = t("User's unfiltered name.");
 
     $tokens['user']['uid']            = t("User's ID");
     $tokens['user']['mail']           = t("User's email address");
