mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 20:10:18 +02:00
[ticket/12275] Fix a bug on the event "core.modify_username_string"
Call the event "core.modify_username_string" also if $mode is "colour", "username" or "profile". PHPBB3-12275
This commit is contained in:
@@ -1319,7 +1319,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
||||
// Return colour
|
||||
if ($mode == 'colour')
|
||||
{
|
||||
return $username_colour;
|
||||
$username_string = $username_colour;
|
||||
break;
|
||||
}
|
||||
|
||||
// no break;
|
||||
@@ -1339,7 +1340,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
||||
// Return username
|
||||
if ($mode == 'username')
|
||||
{
|
||||
return $username;
|
||||
$username_string = $username;
|
||||
break;
|
||||
}
|
||||
|
||||
// no break;
|
||||
@@ -1360,12 +1362,15 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
||||
// Return profile
|
||||
if ($mode == 'profile')
|
||||
{
|
||||
return $profile_url;
|
||||
$username_string = $profile_url;
|
||||
break;
|
||||
}
|
||||
|
||||
// no break;
|
||||
}
|
||||
|
||||
if (empty($username_string))
|
||||
{
|
||||
if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
|
||||
{
|
||||
$username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
|
||||
@@ -1374,6 +1379,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
||||
{
|
||||
$username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this event to change the output of get_username_string()
|
||||
|
Reference in New Issue
Block a user