=== modified file 'sites/all/modules/webform/webform.module'
--- sites/all/modules/webform/webform.module	2010-01-24 05:55:23 +0000
+++ sites/all/modules/webform/webform.module	2010-07-03 20:40:34 +0000
@@ -2138,6 +2138,24 @@
   global $user;
   static $replacements;
 
+  // Don't do any filtering if the string is empty.
+  if (strlen(trim($string)) == 0) {
+    return $string;
+  }
+
+  // Token module replacements
+  if (module_exists('token')) {
+      $reptypes = array('global' => NULL, 'user' => $user);
+      if(isset($node)) {
+        $reptypes += array('node' => $node);
+      }
+      if (module_exists('token_profile2')) {
+        $reptypes += array('uprofile' => $user, 'profile' => $user);
+      }
+
+      $string = token_replace_multiple($string, $reptypes, '[[', ']]');
+  }
+
   // Setup default token replacements.
   if (!isset($replacements)) {
     $replacements['unsafe'] = array();
@@ -2354,6 +2372,18 @@
     '#collapsed' => TRUE,
     '#children' => '<div>'. $output .'</div>',
   );
+  if (module_exists('token')) {
+    if (module_exists('token_profile2')) {
+      $token_help = array('global', 'user', 'profile', 'uprofile');
+    }
+    else {
+      $token_help = array('global', 'user');
+    }
+
+    $fieldset['#children'] .= '<br/><p>' . t("Additional token values from Drupal's standard token replacement mechanism. Please make sure that, unlike most other places where these tokens are used, you surround them by <em>two</em> square brackets; '<strong>[[</strong>' and '<strong>]]</strong>'. </p>")
+       . theme('token_help', $token_help, '[[', ']]');
+  }
+
   return theme('fieldset', $fieldset);
 }
 

