aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-12-11 14:46:38 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-12-11 14:46:38 +0000
commit5a0d7717f67578636acf8300f0ddf5b9a862ead4 (patch)
tree2ea612d21afbc7d6279c7a51acddea33a41a92b7
parentb34f4623146798e18a1021b2ebe716566e68cea8 (diff)
downloadforums-5a0d7717f67578636acf8300f0ddf5b9a862ead4.tar
forums-5a0d7717f67578636acf8300f0ddf5b9a862ead4.tar.gz
forums-5a0d7717f67578636acf8300f0ddf5b9a862ead4.tar.bz2
forums-5a0d7717f67578636acf8300f0ddf5b9a862ead4.tar.xz
forums-5a0d7717f67578636acf8300f0ddf5b9a862ead4.zip
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
-rw-r--r--phpBB/includes/functions_content.php6
1 files changed, 3 insertions, 3 deletions
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')