mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-26 13:18:54 +00:00
Merge pull request #2199 from Zoddo/ticket/12275
[ticket/12275] Fix a bug on the event "core.modify_username_string" * Zoddo/ticket/12275: [ticket/12275] Change if (empty) to if (!isset) [ticket/12275] Fix a bug on the event "core.modify_username_string"
This commit is contained in:
commit
c7f51ca1a7
1 changed files with 16 additions and 10 deletions
|
@ -1348,7 +1348,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;
|
||||
|
@ -1368,7 +1369,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
|||
// Return username
|
||||
if ($mode == 'username')
|
||||
{
|
||||
return $username;
|
||||
$username_string = $username;
|
||||
break;
|
||||
}
|
||||
|
||||
// no break;
|
||||
|
@ -1389,19 +1391,23 @@ 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 (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
|
||||
if (!isset($username_string))
|
||||
{
|
||||
$username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$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']);
|
||||
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']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$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']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue