From 5a0d7717f67578636acf8300f0ddf5b9a862ead4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 11 Dec 2008 14:46:38 +0000 Subject: Fix bug #38655 - Since guest_username is only used for anonymous we revert back to user_id being the cache key and not caching anonymous usernames at all - the code changes are as minimal as possible git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9184 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_content.php') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 1228f8e567..f5c0786fed 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1144,7 +1144,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al /** * Get username details for placing into templates. -* This function caches all modes on first call, except for no_profile - determined by $user_id/$guest_username combination. +* This function caches all modes on first call, except for no_profile and anonymous user - determined by $user_id. * * @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link) * @param int $user_id The users id @@ -1161,10 +1161,10 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', static $_profile_cache; static $_base_profile_url; - $cache_key = $user_id . (string) $guest_username; + $cache_key = $user_id; // If the get_username_string() function had been executed once with an (to us) unkown mode, all modes are pre-filled and we can just grab it. - if (isset($_profile_cache[$cache_key][$mode])) + if ($user_id && $user_id != ANONYMOUS && isset($_profile_cache[$cache_key][$mode])) { // If the mode is 'no_profile', we simply construct the TPL code due to calls to this mode being very very rare if ($mode == 'no_profile') -- cgit v1.2.1