|
From: Meik S. <acy...@ph...> - 2008-12-11 14:47:04
|
Author: acydburn
Date: Thu Dec 11 14:46:38 2008
New Revision: 9184
Log:
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
Modified:
branches/phpBB-3_0_0/phpBB/includes/functions_content.php
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_content.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_content.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_content.php Thu Dec 11 14:46:38 2008
***************
*** 1144,1150 ****
/**
* 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.
*
* @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
--- 1144,1150 ----
/**
* Get username details for placing into templates.
! * 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,1170 ****
static $_profile_cache;
static $_base_profile_url;
! $cache_key = $user_id . (string) $guest_username;
// 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 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')
--- 1161,1170 ----
static $_profile_cache;
static $_base_profile_url;
! $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 ($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')
|