diff options
Diffstat (limited to 'modules/user/user.tokens.inc')
-rw-r--r-- | modules/user/user.tokens.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/user/user.tokens.inc b/modules/user/user.tokens.inc index 5c543984d..6c6862c66 100644 --- a/modules/user/user.tokens.inc +++ b/modules/user/user.tokens.inc @@ -87,7 +87,7 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr case 'name': $name = format_username($account); - $replacements[$original] = $sanitize ? filter_xss($name) : $name; + $replacements[$original] = $sanitize ? check_plain($name) : $name; break; case 'mail': @@ -122,9 +122,10 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr $replacements += token_generate('date', $registered_tokens, array('date' => $account->created), $options); } } + if ($type == 'current-user') { - global $user; - $replacements += token_generate('user', $tokens, array('user' => $user), $options); + $account = user_load($GLOBALS['user']->uid); + $replacements += token_generate('user', $tokens, array('user' => $account), $options); } return $replacements; |