From 03a80ae8bfa69bc11b7b96e4c6649287191d95d5 Mon Sep 17 00:00:00 2001 From: mstxq17 <154380808@qq.com> Date: Tue, 10 Oct 2023 09:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81IP=E5=90=88=E6=B3=95=E6=80=A7?= =?UTF-8?q?,=E9=98=B2=E6=AD=A2SQL=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/function.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/function.php b/include/function.php index 7ad3fa2..8c59455 100644 --- a/include/function.php +++ b/include/function.php @@ -181,7 +181,12 @@ function get_real_ip() { } elseif (isset($_SERVER['REMOTE_ADDR'])) { $real_ip = $_SERVER['REMOTE_ADDR']; } - return $real_ip; + if (filter_var($real_ip, FILTER_VALIDATE_IP)) { + return $real_ip; + } else { + return ""; + } +// return $real_ip; } function yan() { $filename = ROOT.'/assets/data/data.dat';