From e64d0eb790c1ae57bcd09e34f0a153da98b0f08a Mon Sep 17 00:00:00 2001 From: miteruzo Date: Fri, 23 Feb 2024 02:06:41 +0900 Subject: [PATCH] =?UTF-8?q?=E6=94=BB=E6=92=83=E3=81=AE=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- broadcast/index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/broadcast/index.php b/broadcast/index.php index 12773e8..b9a2795 100644 --- a/broadcast/index.php +++ b/broadcast/index.php @@ -11,6 +11,7 @@ $page = (int) ($_GET['p'] ?? 1); $length = (int) ($_GET['max'] ?? 20); $asc = ($_GET['asc'] ?? 0) != 0; $keyword = trim ($_GET['q'] ?? ''); +$escaped = ($_GET['escaped'] ?? 0) != 0; $f = fopen (LOG_PATH, 'r'); @@ -22,9 +23,9 @@ if ($f !== false) $log_data[] = ['date_time' => $dt[0], 'chat_icon' => $chat_info -> author -> imageUrl, - 'chat_name' => $chat_info -> author -> name, - 'chat_message' => $chat_info -> message, - 'answer' => $dt[2]]; + 'chat_name' => $escaped ? htmlspecialchars ($chat_info -> author -> name) : $chat_info -> author -> name, + 'chat_message' => $escaped ? htmlspecialchars ($chat_info -> message) : $chat_info -> message, + 'answer' => $escaped ? htmlspecialchars ($dt[2]) : $dt[2]]; } }