diff --git a/library/includes/functions.php b/library/includes/functions.php index c332c03b7..f966d57a3 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -2175,9 +2175,9 @@ function user_birthday_icon($user_birthday, $user_id): string * Returns information about user ban * * @param int $userId - * @return array + * @return array|null */ -function getUserBanInfo(int $userId): array +function getUserBanInfo(int $userId): ?array { return DB()->fetch_row("SELECT * FROM " . BB_BANLIST . " WHERE ban_userid = $userId LIMIT 1"); } @@ -2185,9 +2185,9 @@ function getUserBanInfo(int $userId): array /** * Returns information about all bans * - * @return array + * @return array|null */ -function getAllBans(): array +function getAllBans(): ?array { return DB()->fetch_rowset("SELECT * FROM " . BB_BANLIST); } diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 8e5ba6b5f..3b2c60af0 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -397,7 +397,7 @@ $userdata =& $user->data; /** * Initial ban check */ -if ($banInfo = getUserBanInfo($user->id)) { +if ($banInfo = getUserBanInfo((int)$user->id)) { if (!IS_GUEST) { $user->session_end(); } diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php index cd0745734..a28e8fd79 100644 --- a/library/includes/ucp/viewprofile.php +++ b/library/includes/ucp/viewprofile.php @@ -75,7 +75,7 @@ if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) { } // Ban information -if ($banInfo = getUserBanInfo($profiledata['user_id'])) { +if ($banInfo = getUserBanInfo((int)$profiledata['user_id'])) { $template->assign_block_vars('ban', [ 'IS_BANNED' => true, 'BAN_REASON' => $banInfo['ban_reason'] diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index 3899ea8a0..90b533d9a 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -295,7 +295,9 @@ ajax.callback.index_data = function(data) {
{postrow.POSTER_NAME} ®
+{L_BANNED}
+ +{postrow.POSTER_RANK}
{postrow.RANK_IMAGE}
{postrow.POSTER_AVATAR}
diff --git a/viewtopic.php b/viewtopic.php index 53274d923..4a881b1be 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -736,7 +736,7 @@ for ($i = 0; $i < $total_posts; $i++) { ]); // Ban information - if ($banInfo = getUserBanInfo($poster_id)) { + if ($banInfo = getUserBanInfo((int)$poster_id)) { $template->assign_block_vars('postrow.ban', [ 'IS_BANNED' => true, 'BAN_REASON' => $banInfo['ban_reason']