From 823b947ce65b2482bc9218776cbc5241b28d3369 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 17 Mar 2023 12:48:15 +0700 Subject: [PATCH] Fixed issue with generate_user_info (#610) --- library/includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/includes/functions.php b/library/includes/functions.php index 8a6ef44ee..19a3e6461 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -779,9 +779,9 @@ function wbr($text, $max_word_length = HTML_WBR_LENGTH) return preg_replace("/([\w\->;:.,~!?(){}@#$%^*\/\\\\]{" . $max_word_length . "})/ui", '$1', $text); } -function generate_user_info($row, $group_mod = null): array +function generate_user_info($row, bool $group_mod = false): array { - global $lang, $images, $bb_cfg; + global $userdata, $lang, $images, $bb_cfg; $from = !empty($row['user_from']) ? $row['user_from'] : $lang['NOSELECT']; $joined = bb_date($row['user_regdate'], 'Y-m-d H:i', false); @@ -790,7 +790,7 @@ function generate_user_info($row, $group_mod = null): array $pm = $bb_cfg['text_buttons'] ? '' . $lang['SEND_PM_TXTB'] . '' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; $avatar = get_avatar($row['user_id'], $row['avatar_ext_id'], !bf($row['user_opt'], 'user_opt', 'dis_avatar'), 50, 50); - if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || ($group_mod ?? IS_ADMIN)) { + if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || IS_AM || $group_mod || ($row['user_id'] == $userdata['user_id'])) { $email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&" . POST_USERS_URL . "=" . $row['user_id']) : 'mailto:' . $row['user_email']; $email = '' . $row['user_email'] . ''; } else {