From dd42385b21eb0df96878d4f3ffc773e306b2cac1 Mon Sep 17 00:00:00 2001 From: LyLme Date: Wed, 20 Dec 2023 00:48:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=8F=E6=9C=BA=E4=B8=80?= =?UTF-8?q?=E8=A8=80=E9=83=A8=E5=88=86=E7=8E=AF=E5=A2=83=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/function.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/function.php b/include/function.php index 3e49226..9747686 100644 --- a/include/function.php +++ b/include/function.php @@ -212,6 +212,9 @@ function get_real_ip() function yan() { $filename = ROOT . '/assets/data/data.dat'; + if (!file_exists($filename) || !is_readable($filename)) { + die(' 一言数据文件不存在或不可读'); + } $data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); // 随机获取一行索引 $result = $data[array_rand($data)];