diff options
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 15df4959b..69c4b77a8 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1076,15 +1076,17 @@ function user_init() { } function user_current_load($arg) { - return $arg ? user_load($arg) : FALSE; + return user_load($arg ? $arg : $GLOBALS['user']->uid); } +/** + * Returns the user id of the currently logged in user. + */ function user_current_to_arg($arg) { - - if (is_numeric($arg)) { - return $arg; - } - return $GLOBALS['user']->uid; + // Give back the current user uid when called from eg. tracker, aka. + // with an empty arg. Also use the current user uid when called from + // the menu with a % for the current account link. + return empty($arg) || $arg == '%' ? $GLOBALS['user']->uid : $arg; } /** |