From 29c9d488fb7fa3c0573f7fb7d8d88b7f139bfa67 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 17 Oct 2022 04:55:08 +0800 Subject: [PATCH] fix complain IP show to complainer --- public/complains.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/complains.php b/public/complains.php index 5d841230..9c994922 100644 --- a/public/complains.php +++ b/public/complains.php @@ -114,8 +114,8 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){ if ($user) { printf(' [%s]', urlencode($user->username), $lang_complains['text_view_band_log']); } + printf('
IP: ' . htmlspecialchars($complain['ip'])); } - printf('
IP: ' . htmlspecialchars($complain['ip'])); echo '
', format_comment($complain['body']); end_frame(); // REPLIES @@ -123,7 +123,11 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){ $res = sql_query(sprintf('SELECT * FROM `complain_replies` WHERE complain = %u ORDER BY id DESC', $complain['id'])) or sqlerr(__FILE__, __LINE__); if(mysql_num_rows($res)){ while($row = mysql_fetch_assoc($res)){ - printf('%s @ %s (%s): ', $row['userid'] ? get_plain_username($row['userid']) : $lang_complains['text_complainer'], gettime($row['added']), htmlspecialchars($row['ip'])); + printf('%s @ %s', $row['userid'] ? get_plain_username($row['userid']) : $lang_complains['text_complainer'], gettime($row['added'])); + if ($isAdmin) { + printf(' (%s)', htmlspecialchars($row['ip'])); + } + echo ': '; echo format_comment($row['body']) . '
'; } }else{