Index: webform.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v
retrieving revision 1.124.2.95
diff -u -p -r1.124.2.95 webform.module
--- webform.module	27 Feb 2009 22:35:15 -0000	1.124.2.95
+++ webform.module	4 Apr 2009 05:59:13 -0000
@@ -2098,7 +2098,7 @@ function theme_webform_mail_headers($for
  * Filters all special tokens provided by webform, such as %post and %profile.
  */
 function _webform_filter_values($string, $node = NULL, $submission = NULL, $strict = TRUE) {
-  global $user;
+  global $user, $profile_loaded;
 
   // Setup default token replacements.
   $find = array('%site', '%date');
@@ -2123,8 +2123,13 @@ function _webform_filter_values($string,
   $find[] = '%useremail';
   $replace[] = isset($user->name) ? $user->name : '';
   $replace[] = isset($user->mail) ? $user->mail : '';
-  if ($user->uid && module_exists('profile')) {
-    profile_load_profile($user);
+  // check to see if the user is logged in and the profile has not been loaded
+  if ($user->uid && $profile_loaded !== TRUE) {
+    // see if the profile module exists
+    if (module_exists('profile')) {
+      profile_load_profile($user);
+    }
+    $profile_loaded = TRUE;
   }
 
   // Provide a list of candidates for token replacement.
