diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-24 14:18:43 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-05-24 14:18:43 +0200 |
commit | c7f51ca1a79c98dd607caa89e412ac7dc6c91827 (patch) | |
tree | d5d61b9d69f5a9e8d3ad2735594ec4fa75bd9216 | |
parent | 2aeb795494a1768740b79043f186fd22834afaec (diff) | |
parent | aa5f268ea5d0e9107f5c8154e10a85c46ad20273 (diff) | |
download | forums-c7f51ca1a79c98dd607caa89e412ac7dc6c91827.tar forums-c7f51ca1a79c98dd607caa89e412ac7dc6c91827.tar.gz forums-c7f51ca1a79c98dd607caa89e412ac7dc6c91827.tar.bz2 forums-c7f51ca1a79c98dd607caa89e412ac7dc6c91827.tar.xz forums-c7f51ca1a79c98dd607caa89e412ac7dc6c91827.zip |
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"
-rw-r--r-- | phpBB/includes/functions_content.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index d56f02dd09..01d540620a 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -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') - { - $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']); - } - else + + if (!isset($username_string)) { - $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']); + } } /** |