Skip to content

Commit

Permalink
Display username as tooltip if realname is displayed
Browse files Browse the repository at this point in the history
Fixes #24436
  • Loading branch information
atrol committed May 30, 2018
1 parent fe30950 commit d04095f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/prepare_api.php
Expand Up @@ -74,18 +74,18 @@ function prepare_user_name( $p_user_id ) {
$t_username = user_get_username( $p_user_id );
$t_name = user_get_name( $p_user_id );
if( $t_username != $t_name ) {
$t_tooltip = ' title="' . string_attribute( $t_name ) . '"';
$t_tooltip = ' title="' . string_attribute( $t_username ) . '"';
} else {
$t_tooltip = '';
}

$t_username = string_display_line( $t_username );
$t_name = string_display_line( $t_name );

if( user_exists( $p_user_id ) && user_get_field( $p_user_id, 'enabled' ) ) {
return '<a ' . $t_tooltip . ' href="' . string_sanitize_url( 'view_user_page.php?id=' . $p_user_id, true ) . '">' . $t_username . '</a>';
return '<a ' . $t_tooltip . ' href="' . string_sanitize_url( 'view_user_page.php?id=' . $p_user_id, true ) . '">' . $t_name . '</a>';
}

return '<del ' . $t_tooltip . '>' . $t_username . '</del>';
return '<del ' . $t_tooltip . '>' . $t_name . '</del>';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/print_api.php
Expand Up @@ -220,7 +220,7 @@ function print_user_with_subject( $p_user_id, $p_bug_id ) {

if( user_exists( $p_user_id ) && user_get_field( $p_user_id, 'enabled' ) ) {
$t_email = user_get_email( $p_user_id );
print_email_link_with_subject( $t_email, $t_username, $t_name, $p_bug_id );
print_email_link_with_subject( $t_email, $t_name, $t_username, $p_bug_id );
} else {
$t_name = string_attribute( $t_name );
echo '<span style="text-decoration: line-through">';
Expand Down

0 comments on commit d04095f

Please sign in to comment.