Skip to content

Commit e320ea1

Browse files
atroldregad
authored andcommitted
Always replace User Placeholders with username
MantisBT 2.12.0 changed the way to control the display of users' real name. Because of this, user Placeholders were replaced by the realname instead of the username if the following configuration is used and the current user's access level is >= $g_show_user_realname_threshold: $g_show_realname = ON; $g_show_user_realname_threshold = DEVELOPER; When using such a snippet, real names would be stored in the database, and thus become visible to any user, even those who are not allowed to view real names. To avoid the problem, we now always replace User Placeholders with the username, regardless of show_realname settings. Fixes #37 Signed-off-by: Damien Regad <[email protected]> Original commit message reworded.
1 parent 2c52034 commit e320ea1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Snippets.API.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ public static function patterns($snippets, $bug_id) {
140140
$bug = bug_get($bug_id);
141141
user_cache_array_rows(array($bug->reporter_id, $bug->handler_id, $current_user));
142142

143-
$reporter = user_get_name($bug->reporter_id);
143+
$reporter = user_get_username($bug->reporter_id);
144144

145145
if($bug->handler_id != NO_USER) {
146-
$handler = user_get_name($bug->handler_id);
146+
$handler = user_get_username($bug->handler_id);
147147
}
148148

149149
$project = project_get_name($bug->project_id);
150-
$username = user_get_name($current_user);
150+
$username = user_get_username($current_user);
151151
} else {
152-
$username = user_get_name($current_user);
152+
$username = user_get_username($current_user);
153153
$reporter = $username;
154154
$project = project_get_name(helper_get_current_project());
155155
}

0 commit comments

Comments
 (0)