From 71c32633357be30bd052709796b7d8a6601e7e21 Mon Sep 17 00:00:00 2001 From: Canglan Date: Thu, 22 Oct 2026 13:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9C=80=E4=BD=8E=20PHP=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8F=90=E5=8D=87=E8=87=B3=208.4=EF=BC=88?= =?UTF-8?q?=E8=A7=84=E9=81=BF=E6=97=A7=E7=89=88=E6=9C=AC=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=20CVE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. frontend/config.php 增加 PHP 版本校验:低于 8.4 拒绝运行并提示升级(upgrade.php 同步生效) 2. README 技术栈与版本要求更新为 PHP 8.4+ 3. 已扫描全部前端 PHP 代码:无 8.1~8.4 弃用/移除用法(隐式可空参数、strftime、utf8_encode、get_class() 无参等) --- README.md | 4 +++- frontend/config.php | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42ea6ca..c33e160 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,9 @@ | 后端框架 | FastAPI | 0.104+ | | 数据库 | MySQL | 5.7 | | 缓存 | Redis | 7.x | -| 前端 | PHP | 8.0 | +| 前端 | PHP | 8.4 | + +> 前端要求 **PHP 8.4+**:旧版本已停止安全维护、存在已知 CVE,低于 8.4 时前端将拒绝运行并提示升级。 | Web服务器 | Nginx | 1.28+ | ## 文件结构 diff --git a/frontend/config.php b/frontend/config.php index 399f42a..aa864af 100644 --- a/frontend/config.php +++ b/frontend/config.php @@ -10,6 +10,12 @@ * 版权所有 © Sea Network Technology Studio */ +// PHP 版本要求:8.4+(旧版本已停止安全维护,存在已知漏洞) +if (PHP_VERSION_ID < 80400) { + http_response_code(500); + die('系统要求 PHP 8.4 或更高版本(当前版本:' . PHP_VERSION . ')。请先升级服务器 PHP 版本以规避已知安全漏洞。'); +} + // 读取.env文件 $envFile = __DIR__ . '/.env'; $config = [];